Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meta members have incorrect type #54

Closed
aleslanik2 opened this issue Aug 1, 2019 · 3 comments · Fixed by #55
Closed

Meta members have incorrect type #54

aleslanik2 opened this issue Aug 1, 2019 · 3 comments · Fixed by #55
Labels
bug Something isn't working

Comments

@aleslanik2
Copy link

Hi,
i upgraded json_api library from 1.0.1 to 2.0.1+1 and library failed on parsing meta object in relationships.

The library expects Map<String, String> json object but official specification allows
unrestricted json object (see https://jsonapi.org/format/#document-meta)

Stacktrace:
type '_InternalLinkedHashMap<String, dynamic>' is not a subtype of type 'Map<String, String>'
#0 IdentifierObject.decodeJson (package:json_api/src/document/identifier_object.dart:16:67)
#1 MappedListIterable.elementAt (dart:_internal/iterable.dart:414:29)
#2 ListIterator.moveNext (dart:_internal/iterable.dart:343:26)
#3 List.addAll (dart:core-patch/growable_array.dart:193:13)
#4 new ToMany (package:json_api/src/document/relationship.dart:121:18)
#5 ToMany.decodeJson (package:json_api/src/document/relationship.dart:131:18)
#6 Relationship.decodeJson (package:json_api/src/document/relationship.dart:38:25)
#7 Relationship.decodeJsonMap. (package:json_api/src/document/relationship.dart:53:62)
#8 __InternalLinkedHashMap&_HashVMBase&MapMixin.map (dart:collection/maps.dart:163:28)
#9 Relationship.decodeJsonMap (package:json_api/src/document/relationship.dart:53:12)
#10 ResourceObject.decodeJson (package:json_api/src/document/resource_object.dart:42:41)
#11 MappedListIterable.elementAt (dart:_internal/iterable.dart:414:29)
#12 ListIterator.moveNext (dart:_internal/iterable.dart:343:26)
#13 List.addAll (dart:core-patch/growable_array.dart:193:13)
#14 new ResourceCollectionData (package:json_api/src/document/resource_collection_data.dart:19:21)
#15 ResourceCollectionData.decodeJson (package:json_api/src/document/resource_collection_data.dart:27:16)
#16 Document.decodeJson (package:json_api/src/document/document.dart:43:42)
#17 JsonApiClient._call (package:json_api/src/client/client.dart:177:44)

#18 JsonApiClient.fetchCollection (package:json_api/src/client/client.dart:31:7)

Thanks for your reply
(And sorry for creepy english)

@f3ath f3ath added the bug Something isn't working label Aug 1, 2019
@f3ath
Copy link
Owner

f3ath commented Aug 1, 2019

Thanks for the report. I'm gonna get it fixed today.

@f3ath f3ath changed the title relationships meta problem Meta members have incorrect type Aug 1, 2019
@f3ath f3ath mentioned this issue Aug 1, 2019
@f3ath f3ath closed this as completed in #55 Aug 1, 2019
f3ath added a commit that referenced this issue Aug 1, 2019
@f3ath
Copy link
Owner

f3ath commented Aug 1, 2019

v 2.0.2 has been published. @aleslanik2 please confirm the issue is fixed.

@f3ath f3ath reopened this Aug 1, 2019
@aleslanik2
Copy link
Author

Yes, I am confirming that it's okay.
Thanks a lot for a super speed fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants