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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ port: 9876
collections:
format:
output: true
errors:
output: true
profiles:
output: true
permalink: /:collection/:path
Expand All @@ -66,7 +68,14 @@ defaults:
path: ""
type: "profiles"
values:
layout: profile_error
layout: error
is_spec_page: false
show_sidebar: false
- scope:
path: ""
type: "errors"
values:
layout: error
is_spec_page: false
show_sidebar: false
- scope:
Expand Down
3 changes: 3 additions & 0 deletions _errors/profile-not-supported.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
redirect_to: /format/1.1/#profile-query-parameter
---
8 changes: 7 additions & 1 deletion _format/1.1/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -1970,7 +1970,13 @@ query parameter **MUST** equal a URI-encoded whitespace-separated list of profil

If a server receives a request requiring the application of a profile or
combination of profiles that it can not apply, it **MUST** respond with a `400
Bad Request` status code.
Bad Request` status code. The response **MUST** contain an [error object] that
identifies the `profile` query parameter as the `source` and has the following
URI as (one of) its `type`s:

```
https://jsonapi.org/errors/profile-not-supported
```

> Note: When a client lists a profile in the `Accept` header, it's asking the
> server to compute its response as normal, but then send the response document
Expand Down
File renamed without changes.
0