Support for reading meta inside Resource Objects
yosfik opened this issue · 3 comments
Hi @stjepanbanek and team, thanks for the work.
As per this JSON API spec, meta
may be included inside a resource object.
// ...
{
"type": "articles",
"id": "1",
"attributes": {
"title": "Rails is Omakase"
},
"relationships": {
"author": {
"links": {
"self": "/articles/1/relationships/author",
"related": "/articles/1/author"
},
"data": { "type": "people", "id": "9" }
}
}
"meta": {
"copyright": "Copyright 2015 Example Corp.",
"authors": [
"Yehuda Katz",
"Steve Klabnik",
"Dan Gebhardt",
"Tyler Kellen"
]
}
}
// ...
As far as I know and tried, currently kotlin-jsonapix only support reading top level meta
. Is there any plan to support reading meta
inside each resource object?
Hi @yosfik and thanks for your feedback!
You are right, we currently only support meta coming from the root object.
We have plans for adding the support for meta in resource objects (also in the included block) and in relationships.
This will be done for the stable release.
I'm hoping that your experience with the lib is good otherwise.
@stjepanbanek thanks for responding. We've got quite a few people over here at Vidio.com working on this "standardize API requests through KMM" and that meta is quite key... would you be open to the team submitting a patch w/tests to support meta?
@sillylogger feel free to fork. I would be happy to see some PRs also, but if it's too much effort for you, you don't have to.
I will keep this in mind and add meta to resource objects as soon as I can.
Also, unfortunately the lib doesn't yet work with KMM even though we thought it would. Later we figured out, that additional changes are needed in order to make it work. This is also planned, but I can't tell when it would be live.