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()';
@override
String deserialize(final String object, {final bool toBuilder = false}) {
if (name == 'JsonObject') {
return 'JsonObject($object)${nullable ? '?' : ''}';
}
return '($object as $nullableName)';
}
String deserialize(final String object, {final bool toBuilder = false}) => '($object as $nullableName)';
@override
String decode(final String object) {

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

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

Loading…
Cancel
Save