From 19e1616a7ccb2299961682395573c6d7dd18b613 Mon Sep 17 00:00:00 2001 From: Koen Van Looveren Date: Tue, 6 Oct 2020 13:21:07 +0200 Subject: [PATCH] FIxed some typos --- CHANGELOG.md | 5 ++++- README.md | 12 +++++++++++- bin/src/config/yml_generator_config.dart | 6 +++--- pubspec.yaml | 2 +- 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2307c6d..115511d 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,10 @@ # Changelog -## [2.4.0 - WIP] - 2020-10-04 +## [3.0.0] - 2020-10-06 +### Breaking Change +- renamed includeIfNull to include_if_nul to keep a consistent api ### Added +- Added unknown_enum_value support - Added non_final support ## [2.3.0] - 2020-10-04 diff --git a/README.md b/README.md index 3138c80..7e97507 100755 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ UserModel: dynamicField: type: dynamic includeIfNullField: - includeIfNull: false #If this field is null, this field will not be added to your json object (used for PATCH models) + include_if_null: false #If this field is null, this field will not be added to your json object (used for PATCH models) type: string ignoreField: ignore: false #this field will not be final, and not be used in the json parsing @@ -102,6 +102,16 @@ Gender: Y: ``` +### Use unknownEnumValue +``` +UnknownEnumTestObject: + path: webservice + properties: + path: + unknown_enum_value: X + type: Gender +``` + ## Custom object Support for custom objects that are not generated by the model generator diff --git a/bin/src/config/yml_generator_config.dart b/bin/src/config/yml_generator_config.dart index 0511034..9f65bea 100644 --- a/bin/src/config/yml_generator_config.dart +++ b/bin/src/config/yml_generator_config.dart @@ -75,9 +75,9 @@ class YmlGeneratorConfig { property.containsKey('ignore') && property['ignore'] == true; final nonFinal = ignored || property.containsKey('non_final') && property['non_final'] == true; - final includeIfNull = property.containsKey('includeIfNull') && - property['includeIfNull'] == false; - final unknownEnumValue = property['unknownEnumValue']; + final includeIfNull = property.containsKey('include_if_null') && + property['include_if_null'] == false; + final unknownEnumValue = property['unknown_enum_value']; final jsonKey = property['jsonKey'] ?? property['jsonkey']; final type = property['type']; ItemType itemType; diff --git a/pubspec.yaml b/pubspec.yaml index d7e9e97..b9640c7 100755 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: model_generator description: Dart tool to automaticly generate models from a yml file to speed up your development flow. -version: 2.3.0 +version: 3.0.0 homepage: https://github.com/icapps/flutter-model-generator environment: