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

Tweaks to docs on error responses #4245

Merged
merged 1 commit into from
Mar 27, 2016
Merged

Tweaks to docs on error responses #4245

merged 1 commit into from
Mar 27, 2016

Conversation

pablobm
Copy link
Contributor

@pablobm pablobm commented Mar 18, 2016

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 think DS.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.

@bmac
Copy link
Member

bmac commented Mar 18, 2016

Looks great @pablobm. 👍

@bmac
Copy link
Member

bmac commented Mar 18, 2016

To generate the API docs there is a rake generate_ember_data_docs command in the website repo that assumes the Ember Data repo is an a folder called ember-data that lives adjacent to the folder where the website is checked out.

```

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
Copy link
Member

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 ..."?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like

@pablobm
Copy link
Contributor Author

pablobm commented Mar 19, 2016

OK. I'll have another pass during the weekend. Thank you for the feedback.

@pablobm
Copy link
Contributor Author

pablobm commented Mar 20, 2016

I'm happy with this now. Any other comments?

@pangratz
Copy link
Member

LGTM, can you squash all commits into 1, prefixed with [DOC]? Thanks!

@pablobm
Copy link
Contributor Author

pablobm commented Mar 27, 2016

@pangratz: done

@bmac bmac merged commit 688bad1 into emberjs:master Mar 27, 2016
@bmac
Copy link
Member

bmac commented Mar 27, 2016

Thanks @pablobm.

@pablobm pablobm deleted the errors-docs branch March 28, 2016 07:26
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

Successfully merging this pull request may close these issues.

3 participants