8000 feat(format): better define unsupported client-required profile error by ethanresnick · Pull Request #1330 · json-api/json-api · GitHub
[go: up one dir, main page]

Skip to content

feat(format): better define unsupported client-required profile error #1330

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

Merged
merged 1 commit into from
Dec 4, 2018

Conversation

ethanresnick
Copy link
Member
@ethanresnick ethanresnick commented Dec 3, 2018

When the client requires a profile that the server doesn't support (using the ?profile param), return a more-specific error response leveraging the new type mechanism.

@ethanresnick ethanresnick requested a review from dgeb December 3, 2018 16:56
Copy link
Member
@dgeb dgeb left a comment

Choose a reason for hiding this comment

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

This seems good to me. It's a nice use of the new error type and more useful to a client than a plain 400 response.

@ethanresnick
Copy link
Member Author

👍

@ethanresnick ethanresnick merged commit 66871d0 into gh-pages Dec 4, 2018
@ethanresnick ethanresnick deleted the profile-errors-2 branch December 5, 2018 05:10
@wimleers
Copy link
Contributor
wimleers commented Dec 21, 2018

Nice!

I totally agree with

It's a nice use of the new error type and more useful to a client than a plain 400 response.

I'm looking forward to updating the Drupal JSON:API implementations with concrete type URLs — we already have helpful messages, but this will make those errors easier to document!

@ethanresnick
Copy link
Member Author

I'm looking forward to updating the Drupal JSON:API implementations with concrete type URLs — we already have helpful messages, but this will make those errors easier to document!

@wimleers Same. I'd love to create a set of error URIs on jsonapi.org that show canonical docs when dereferenced. Then, all the server implementations can point to those and get docs for free. I'm gonna open a PR with the errors that my implementation already has, and give you push access to the branch... hopefully you can add to it any errors from Drupal's implementation.

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
0