-
Notifications
You must be signed in to change notification settings - Fork 39
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
Json api link templates #27
Conversation
Class.new(Oat::Serializer) do | ||
schema do | ||
type 'users' | ||
link_template "user.managers", "http://foo.bar.com/{user.id}/managers" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be implemented as part of the existing link
DSL method? Other formats such as HAL also support link templates and it looks like this could be part of the generic link DSL. For example
link 'user.managers', href: "http://foo.bar.com/{user.id}/managers", templated: true
I don't particularly like overloading methods with hash options too much, but it looks like many adapters could benefit from link templates.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, that makes sense over a new method. I'll get that taken care of. Probably after #26 is squared away.
Json api attribute links It makes sense holding off the gem release until #27 is also merged I think. Good to have a fully-implemented JsonAPI at last!
I've change this to |
Can we add this to the Readme? After that it's good to go. |
Where do you see this going? There is nothing JSON API specific in the README and your goal is to have this adapter extracted into its own gem. On Monday, March 24, 2014 at 12:43 PM, Ismael Celis wrote:
|
Yeah, I just don't like to have too many hidden undocumented features... Do you think we should wait until JsonAPI support is complete before creating that new gem? |
I was waiting for the api decision needed to resolve #16 and #19 before extracting it out. I’ll add a note about templates: true in the Defining Properties section somewhere. |
I've resolved conflicts and merged #16 I'm still not happy with how it forces you to have conditional checks in every adapter, but in the meantime it allows us to move forward. I might revisit @shekibobo's idea of using a null serializer (#21) to try and make adapter's a bit nicer. |
Let me know if the README update looks good. Now that you've merged #16 you'd like me to extract the json api functionality, right? Any suggestions on a name. "oat-jsonapi"? |
Thanks, the readme looks Ok.
|
Would you mind pulling this in and releasing a new version (maybe 0.3.0 due to the adapter api change)? This would allow me to continue with my project and give me time to extract the json api into a gem to maybe be released along side an oat 0.4.0. N.B. the Travis failure it due to Rake 10.2 being release. #29 should fix those failures. |
Done! |
Woohoo! Thanks On Tuesday, March 25, 2014 at 11:35 AM, Ismael Celis wrote:
|
This adds support for the top level links in the JSON API