Open doomspork opened 2 years ago
I found potentially 2 other issues with our parsing:
"data"
but per the spec it is not required: https://jsonapi.org/format/#document-resource-object-relationships. In our case some of our associated data only includes a "link"
key.This issue has been automatically marked as "stale:discard". We are sorry that we haven't been able to prioritize it yet. If this issue still relevant, please leave any comment if you have any new additional information that helps to solve this issue. We encourage you to create a pull request, if you can. We are happy to help you with that.
I need to flatten some JSON:API data down in another project so I wanted to look at whether I could leverage the
JSONAPI.Utils.DataToParams.process/1
functionality. When I passed in our JSON:API data I got an error:When I went to the line specified to see what was expected I noticed that we expected a
"data"
key in each included resources: https://github.com/jeregrine/jsonapi/blob/master/lib/jsonapi/utils/data_to_params.ex#L97 and that's reflected in our tests: https://github.com/jeregrine/jsonapi/blob/master/test/utils/data_to_params_test.exs#L96-L132I believe this to be incorrect. If we look at https://jsonapi.org they do not have the
"data"
key in each of the included resources:If someone else can verify this is in fact a bug I can put together a PR to correct this.