Skip to content

Commit

Permalink
Merge pull request #9809 from MichaelMarner/dart-double-cast
Browse files Browse the repository at this point in the history
#9808 - Dart double cast
  • Loading branch information
HugoMario authored Dec 15, 2020
2 parents aa1f65d + 5c85257 commit dad68cb
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ class {{classname}} {
(json['{{baseName}}'] as List).map((item) => item as {{items.datatype}}).toList()
{{/isListContainer}}
{{^isListContainer}}
{{#isDouble}}
json['{{baseName}}'] == null ? null : json['{{baseName}}'].toDouble()
{{/isDouble}}
{{^isDouble}}
json['{{baseName}}']
{{/isDouble}}
{{/isListContainer}}
{{/complexType}};
{{/isDateTime}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.4.3-SNAPSHOT
2.4.10-SNAPSHOT
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Amount {
Amount.fromJson(Map<String, dynamic> json) {
if (json == null) return;
value =
json['value']
json['value'] == null ? null : json['value'].toDouble()
;
currency =

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.4.3-SNAPSHOT
2.4.10-SNAPSHOT
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Amount {
Amount.fromJson(Map<String, dynamic> json) {
if (json == null) return;
value =
json['value']
json['value'] == null ? null : json['value'].toDouble()
;
currency =

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.4.3-SNAPSHOT
2.4.10-SNAPSHOT
2 changes: 1 addition & 1 deletion samples/client/petstore/dart/swagger/lib/model/amount.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Amount {
Amount.fromJson(Map<String, dynamic> json) {
if (json == null) return;
value =
json['value']
json['value'] == null ? null : json['value'].toDouble()
;
currency =

Expand Down

0 comments on commit dad68cb

Please sign in to comment.