-
-
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
Tweaks to docs on error responses #4245
Conversation
Looks great @pablobm. 👍 |
To generate the API docs there is a |
``` | ||
|
||
This adapter does not make any assumptions as to the format of the `errors` | ||
object. It will simply be passed along as a black box, wrapped in an instance |
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.
Hmm, IMHO "be passed along as a black box, wrapped ..." is a little confusing here. What do you think of "be passed along as is, wrapped ..."?
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.
I like
OK. I'll have another pass during the weekend. Thank you for the feedback. |
I'm happy with this now. Any other comments? |
LGTM, can you squash all commits into 1, prefixed with |
@pangratz: done |
Thanks @pablobm. |
Wut?
Recently I was looking at how to get errors to work, and found the docs slightly confusing. I decided to give it a go and see if I could improve them in some way. This is what I got so far.
Does this make sense? I probably can add some other details and make corrections, but I wanted to fly this past you before spending more time on it. I'm happy to take any feedback you may have.
Rationale
I removed the example provided at
addon/-private/system/model/errors.js
because I feel it can lead to confusion making people thinkDS.Errors
actually expects responses in a specific format.I think the docs at
addon/adapters/rest.js
need to be more explicit at to what exactly it expects.I think the JSON example belongs in
addon/serializers/json.js
, with details of what keys are actually used. The JSON-API spec lists a few keys that "MAY" appear here, and users need information as to which ones ember-data actually uses.Incidentally...
I have no idea of how to generate the docs from this code. I figured out how to do it for ember, using yuidoc, but I don't know what the procedure is for ember-data. Hence, I haven't been able to read the results, and my Markdown may have errors I haven't been able to spot.