Skip to content

Commit 191e781

Browse files
committed
feat(format): better define unsupported client-required profile error
1 parent 6f7e59e commit 191e781

File tree

4 files changed

+20
-2
lines changed

4 files changed

+20
-2
lines changed

_config.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ port: 9876
5050
collections:
5151
format:
5252
output: true
53+
errors:
54+
output: true
5355
profiles:
5456
output: true
5557
permalink: /:collection/:path
@@ -66,7 +68,14 @@ defaults:
6668
path: ""
6769
type: "profiles"
6870
values:
69-
layout: profile_error
71+
layout: error
72+
is_spec_page: false
73+
show_sidebar: false
74+
- scope:
75+
path: ""
76+
type: "errors"
77+
values:
78+
layout: error
7079
is_spec_page: false
7180
show_sidebar: false
7281
- scope:

_errors/profile-not-supported.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
redirect_to: /format/1.1/#profile-query-parameter
3+
---

_format/1.1/index.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1970,7 +1970,13 @@ query parameter **MUST** equal a URI-encoded whitespace-separated list of profil
19701970

19711971
If a server receives a request requiring the application of a profile or
19721972
combination of profiles that it can not apply, it **MUST** respond with a `400
1973-
Bad Request` status code.
1973+
Bad Request` status code. The response **MUST** contain an [error object] that
1974+
identifies the `profile` query parameter as the `source` and has the following
1975+
URI as (one of) its `type`s:
1976+
1977+
```
1978+
https://jsonapi.org/errors/profile-not-supported
1979+
```
19741980

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

0 commit comments

Comments
 (0)