File tree Expand file tree Collapse file tree 3 files changed +9
-0
lines changed
modules/openapi-generator/src/main/resources/dart2
samples/openapi3/client/petstore/dart2
petstore_client_lib_fake/lib Expand file tree Collapse file tree 3 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,9 @@ Future<String> _decodeBodyBytes(Response response) async {
6969/// Returns a valid [T] value found at the specified Map [key], null otherwise.
7070T? mapValueOfType<T >(dynamic map, String key) {
7171 final dynamic value = map is Map ? map[key] : null;
72+ if (T == double && value is int) {
73+ return value.toDouble() as T;
74+ }
7275 return value is T ? value : null;
7376}
7477
Original file line number Diff line number Diff line change @@ -70,6 +70,9 @@ Future<String> _decodeBodyBytes(Response response) async {
7070/// Returns a valid [T] value found at the specified Map [key] , null otherwise.
7171T ? mapValueOfType <T >(dynamic map, String key) {
7272 final dynamic value = map is Map ? map[key] : null ;
73+ if (T == double && value is int ) {
74+ return value.toDouble () as T ;
75+ }
7376 return value is T ? value : null ;
7477}
7578
Original file line number Diff line number Diff line change @@ -88,6 +88,9 @@ Future<String> _decodeBodyBytes(Response response) async {
8888/// Returns a valid [T] value found at the specified Map [key] , null otherwise.
8989T ? mapValueOfType <T >(dynamic map, String key) {
9090 final dynamic value = map is Map ? map[key] : null ;
91+ if (T == double && value is int ) {
92+ return value.toDouble () as T ;
93+ }
9194 return value is T ? value : null ;
9295}
9396
You can’t perform that action at this time.
0 commit comments