api_client.dart.patch 1.1 KB

123456789101112131415161718192021
  1. @@ -144,19 +144,19 @@ class ApiClient {
  2. );
  3. }
  4. - Future<dynamic> deserializeAsync(String json, String targetType, {bool growable = false,}) async =>
  5. + Future<dynamic> deserializeAsync(String json, String targetType, {bool growable = false,}) =>
  6. // ignore: deprecated_member_use_from_same_package
  7. deserialize(json, targetType, growable: growable);
  8. @Deprecated('Scheduled for removal in OpenAPI Generator 6.x. Use deserializeAsync() instead.')
  9. - dynamic deserialize(String json, String targetType, {bool growable = false,}) {
  10. + Future<dynamic> deserialize(String json, String targetType, {bool growable = false,}) async {
  11. // Remove all spaces. Necessary for regular expressions as well.
  12. targetType = targetType.replaceAll(' ', ''); // ignore: parameter_assignments
  13. // If the expected target type is String, nothing to do...
  14. return targetType == 'String'
  15. ? json
  16. - : _deserialize(jsonDecode(json), targetType, growable: growable);
  17. + : _deserialize(await compute((String j) => jsonDecode(j), json), targetType, growable: growable);
  18. }