Closed groyoh closed 5 years ago
Yeah, I was thinking to just wait for JSON-API to get to 1.0
, and then bring Yaks up-to-date. Because I found myself rereading the entire spec to see what changed, but it's easier to just read it just once again when a stable version is released. The official date was supposed to be tomorrow, but they don't look ready yet.
Another thing that we're still missing are errors (https://github.com/plexus/yaks/issues/62). I have a pretty straightforward monkey patch in my app, just telling the JsonApi
formatter to render {:errors => errors}
if the resource type is "error" (I made my own ErrorMapper for displaying application-specific errors, with attributes conforming to the JSON-API standard, just title
, id
and status
). But from the description of the issue it seems that @plexus wants to make general changes in Yaks to support errors, I will see if I can help somehow, even though I'm not familiar with other JSON specifications.
I was looking forward to wait for 1.0 too but as things go I don't know if it will be released tomorrow. In the meantime, it might be easier to add small changes once at a time rather than doing it all at once. This way it may be easier to see what needs to be changed too.
Looks like JSON API will be released on 28th of May and that no changes would be made until then. So we should definitely implement it! :smile: (source: http://jsonapi.org/status/)
Awesome, let's go for it!
How is this going?
@sandelius You can track the progress on https://github.com/plexus/yaks/pull/101 :)
@plexus proposed this for links:
class PostMapper < Yaks::Mapper
has_one :user, mapper: Class.new(UserMapper) { link :self, ... }
end
but the template uri would be evaluated in the user mapper, right? So what if we want to build http://example.com/posts/1/relationships/user where 1 is the post id?
Is this list still accurate?
Some changes has been made to the JSON API format lately. They added a
relationship
key to resource objects with is a pretty big change. It seems that they also plan to changelinkage
todata
. I'll try to make a list of changes that needs to be done and maybe we could keep this issue opened and add new features to the list until they release it.Reference: http://jsonapi.org/format/