Browse Source

Merge pull request #340 from Leptopoda/fix/#334

dynamite, neon: fix plain object deserialization
pull/345/head
Nikolas Rimikis 2 years ago committed by GitHub
parent
commit
f7ffe18ac1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  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