Skip to content
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

Docs for DS.RESTSerializer: normalize, normalizeSave, normalizeResponse, etc. #12319

Closed
elithrar opened this issue Sep 10, 2015 · 2 comments
Closed

Comments

@elithrar
Copy link

I suspect that the normalizeXXXX methods on the DS.RESTSerializer and DS.JSONAPISerializer serializers are commonly used, but given the change from extractXXXX pre ED 2.0 finding solid examples is hard for new users.

Specifically, the docs for these methods should:

  • Address the difference between each method (universal? just on save? just on responses?)
  • Provide an example of 'fixing' common issues—typically JSON responses without a root key, a different id key (_id is common), and/or populating model fields on the save response only.
  • Show how to populate model fields on the response (that were empty on the outgoing save - e.g. rendered text)
  • Clarify the requirements for the output: does it matter if the root key for a single object is pluralized? Does the root key need to be pluralized for an array response? The docs show non-plural vs. plural keys but this doesn't matter: you can just pluralize it all the time.

For myself—as a relative newcomer to Ember—much of the above is discoverable through trial-and-error only, which isn't ideal.

@pixelhandler
Copy link
Contributor

@elithrar this issue should be on the emberjs/data project not the emberjs/ember.js project. Also perhaps join the #documentation channel in the embercommunity.slack.com chat to let them know the need for clarity.

@elithrar
Copy link
Author

You're right—I'll move this over.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants