-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Adds some documentation for JSONApiSerializer #3531
Conversation
gamesPlayed: DS.attr(), | ||
club: DS.belongsTo('club') | ||
}); | ||
App.Club = DS.Model.extend({ |
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.
Lets use Ember CLI style examples for these models.
cheers, will go over your comments. |
players: DS.hasMany('player') | ||
}); | ||
``` | ||
```js |
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.
For some reason code samples don't render correctly unless they have an empty line above the first ```.
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.
@simaob Can you add an empty line between the code examples?
Made changes and pushed. |
`JSONAPISerializer` supports the http://jsonapi.org/ spec and is the | ||
serializer recommended by Ember Data. | ||
|
||
This serializer normalizes a JSONApi payload that looks like: |
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.
JSONApi
=> JSON API
Added some comments about minor things. When that's fixed I'm 👍 to merge |
@wecc made the changes requested. Thanks for the review and sorry for some clumsiness with the capitalization! |
attribute values and serializing relationships. | ||
|
||
`JSONAPISerializer` supports the http://jsonapi.org/ spec and is the | ||
serializer recommended by Ember Data. |
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.
Lines 93-99 are duplicates of 14-20, could be removed.
@simaob I discovered one more thing but other than that looks good. Thank you for your patience! |
Can you also squash the commits and prefix the commit message with |
Should be all set. :) Hope I did it correctly :P |
Adds some documentation for JSONApiSerializer
Thanks |
Following the conversation on #3455, this Pull Request adds some documentation for the JSONApiSerializer, and two of its methods keyForAttribute and keyForRelationship.
This documentation is heavily inspired in the existing documentation of the JSONSerializer, as suggested in the mentioned issue.
I hope it is meets what is expected. Let me know if you think it needs more work.