forked from loafle/openapi-generator-original
Fix dictionary/map deserialization (#19496)
This commit is contained in:
parent
1b30c1995f
commit
ff1fe256d8
@ -52,9 +52,9 @@ final _regMap = RegExp(r'^Map<String,(.*)>$');
|
||||
.toSet() as ReturnType;
|
||||
}
|
||||
if (value is Map && (match = _regMap.firstMatch(targetType)) != null) {
|
||||
targetType = match![1]!; // ignore: parameter_assignments
|
||||
return Map<dynamic, BaseType>.fromIterables(
|
||||
value.keys,
|
||||
targetType = match![1]!.trim(); // ignore: parameter_assignments
|
||||
return Map<String, BaseType>.fromIterables(
|
||||
value.keys as Iterable<String>,
|
||||
value.values.map((dynamic v) => deserialize<BaseType, BaseType>(v, targetType, growable: growable)),
|
||||
) as ReturnType;
|
||||
}
|
||||
|
@ -183,9 +183,9 @@ final _regMap = RegExp(r'^Map<String,(.*)>$');
|
||||
.toSet() as ReturnType;
|
||||
}
|
||||
if (value is Map && (match = _regMap.firstMatch(targetType)) != null) {
|
||||
targetType = match![1]!; // ignore: parameter_assignments
|
||||
return Map<dynamic, BaseType>.fromIterables(
|
||||
value.keys,
|
||||
targetType = match![1]!.trim(); // ignore: parameter_assignments
|
||||
return Map<String, BaseType>.fromIterables(
|
||||
value.keys as Iterable<String>,
|
||||
value.values.map((dynamic v) => deserialize<BaseType, BaseType>(v, targetType, growable: growable)),
|
||||
) as ReturnType;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user