Skip to content

Commit c229767

Browse files
committed
fix: Use API within SDK bounds (will change in future release), fix the analyzer warnings, fmt
1 parent 5003ea1 commit c229767

File tree

4 files changed

+14
-12
lines changed

4 files changed

+14
-12
lines changed

.github/workflows/code_quality.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ jobs:
3131
- name: Install Dependencies
3232
run: dart pub get
3333
- name: Validate formatting
34-
run: dart format --set-exit-if-changed
34+
run: dart format ./ --set-exit-if-changed
3535
- name: Run analyzer
36-
run: dart analyze
36+
run: dart analyze --fatal-warnings
3737
- name: Run tests
3838
run: dart test
3939

openapi-generator-annotations/analysis_options.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
# Defines a default set of lint rules enforced for
2-
# projects at Google. For details and rationale,
3-
# see https://github.com/dart-lang/pedantic#enabled-lints.
4-
include: package:pedantic/analysis_options.yaml
5-
61
# For lint rules and documentation, see http://dart-lang.github.io/linter/lints.
72
# Uncomment to specify additional rules.
83
# linter:

openapi-generator-annotations/lib/src/openapi_generator_annotations_base.dart

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,9 @@ class DioProperties extends AdditionalProperties {
342342

343343
DioProperties.fromMap(Map<String, dynamic> map)
344344
: dateLibrary = EnumTransformer.dioDateLibrary(map['dateLibrary']),
345-
nullableFields = bool.tryParse(map['nullableFields']),
345+
nullableFields = map['nullableFields'] != null
346+
? map['nullableFields'] == 'true'
347+
: null,
346348
serializationLibrary = EnumTransformer.dioSerializationLibrary(
347349
map['serializationLibrary']),
348350
super.fromMap(map);
@@ -416,9 +418,13 @@ class DioAltProperties extends AdditionalProperties {
416418
wrapper: wrapper);
417419

418420
DioAltProperties.fromMap(Map<String, dynamic> map)
419-
: nullSafe = bool.tryParse(map['nullSafe']) ,
420-
nullSafeArrayDefault = bool.tryParse(map['nullSafeArrayDefault'] ),
421-
listAnyOf = bool.tryParse(map['listAnyOf']),
421+
: nullSafe =
422+
map['nullSafe'] != null ? map['nullableFields'] == 'true' : null,
423+
nullSafeArrayDefault = map['nullSafeArrayDefault'] != null
424+
? map['nullSafeArrayDefault'] == 'true'
425+
: null,
426+
listAnyOf =
427+
map['listAnyOf'] != null ? map['listAnyOf'] == 'true' : null,
422428
pubspecDependencies = map['pubspecDependencies'],
423429
pubspecDevDependencies = map['pubspecDevDependencies'],
424430
super.fromMap(map);

openapi-generator-annotations/pubspec.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ environment:
99

1010
dev_dependencies:
1111
test:
12-
source_gen_test: ^1.0.6
12+
source_gen_test: ^1.0.6
13+
lint:

0 commit comments

Comments
 (0)