Skip to content

#9808 - Dart double cast #9809

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Dec 15, 2020
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