Skip to content

Commit

Permalink
Merge pull request #47 from icapps/bugfix/fixed-typos
Browse files Browse the repository at this point in the history
FIxed some typos
  • Loading branch information
vanlooverenkoen committed Oct 6, 2020
2 parents b1c5241 + 19e1616 commit 3749298
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions bin/src/config/yml_generator_config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down

0 comments on commit 3749298

Please sign in to comment.