Skip to content

Commit db8ac13

Browse files
authored
Merge pull request json-api#1306 from json-api/profile-errors-tweaks
cleanup(profiles): special case default handling of unrecognized query param vals
2 parents a47164a + b42163c commit db8ac13

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

_format/1.1/index.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2177,15 +2177,20 @@ when encountering unrecognized values.
21772177
If a profile does not define its own rules for handling unrecognized values,
21782178
the following rule applies by default:
21792179

2180-
1. If the unrecognized value is a JSON object, and the only thing that makes
2181-
it unrecognized is that it contains one or more keys that have no meaning
2182-
assigned to them (in the latest revision of the profile that the application
2183-
is aware of), then the application **MUST** simply ignore those unknown
2184-
keys and continue processing the profile.
2185-
2186-
2. However, in all other cases, the application **MUST** assume that the
2187-
profile has been applied erroneously and **MUST** totally ignore the
2188-
profile (i.e., process the document as if the profile were not there).
2180+
1. If the value of a profile-defined query parameter is unrecognized, the
2181+
server **MUST** fail the request and respond with a `400 Bad Request` and
2182+
an [error object][error objects] indicating the problematic parameter.
2183+
2184+
2. Otherwise, if the unrecognized value is a JSON object in the
2185+
request/response document, and the only thing that makes it unrecognized
2186+
is that it contains one or more keys that have no meaning assigned to them
2187+
(in the latest revision of the profile that the application is aware of),
2188+
then the application **MUST** simply ignore those unknown keys and
2189+
continue processing the profile.
2190+
2191+
3. In all other cases, the application **MUST** assume that the profile has
2192+
been applied erroneously and **MUST** totally ignore the profile (i.e.,
2193+
process the request as if the profile were not there).
21892194

21902195
In the case of our example [timestamps profile], it does not define its own
21912196
rules, so the above defaults would apply.

0 commit comments

Comments
 (0)