Browse Source

dynamite, neon: fix plain object deserialization

pull/340/head
Nikolas Rimikis 2 years ago
parent
commit
5af08398a1
No known key found for this signature in database
GPG Key ID: 85ED1DE9786A4FF2
  1. 8
      packages/dynamite/dynamite/lib/src/type_result/base.dart
  2. 2
      packages/nextcloud/lib/src/nextcloud.openapi.dart

8
packages/dynamite/dynamite/lib/src/type_result/base.dart

@ -21,13 +21,7 @@ class TypeResultBase extends TypeResult {
name == 'String' ? object : '$object.toString()'; name == 'String' ? object : '$object.toString()';
@override @override
String deserialize(final String object, {final bool toBuilder = false}) { String deserialize(final String object, {final bool toBuilder = false}) => '($object as $nullableName)';
if (name == 'JsonObject') {
return 'JsonObject($object)${nullable ? '?' : ''}';
}
return '($object as $nullableName)';
}
@override @override
String decode(final String object) { String decode(final String object) {

2
packages/nextcloud/lib/src/nextcloud.openapi.dart

@ -463,7 +463,7 @@ class NextcloudCoreClient {
body, body,
); );
if (response.statusCode == 200) { if (response.statusCode == 200) {
return JsonObject(JsonObject(utf8.decode(response.body))); return JsonObject(utf8.decode(response.body));
} }
throw NextcloudApiException.fromResponse(response); // coverage:ignore-line throw NextcloudApiException.fromResponse(response); // coverage:ignore-line
} }

Loading…
Cancel
Save