ietf-wg-httpapi / rfc7807bis

Revision of RFC7807: HTTP Problem Details
Other
20 stars 8 forks source link

The validation-error example is wrong(!/?) #42

Closed olijaun closed 2 years ago

olijaun commented 2 years ago

Hi

In the spec there is a validation-error problem example:

HTTP/1.1 400 Bad Request
Content-Type: application/problem+json
Content-Language: en

{
 "type": "https://example.net/validation-error",
 "title": "Your request is not valid.",
 "causes": [
             {
               "detail": "must be a positive integer",
               "problem-pointer": "#/age"
             },
             {
               "detail": "must be 'green', 'red' or 'blue'",
               "problem-pointer": "#/profile/color"
             }
          ]
  }

In section 3.2 (Extension Members) it says:

Similarly, the "Multi-Status" example defines two extensions -- "causes" and "problem-pointer".

This actually means that each element in "causes" is a problem itself (otherwise there would not be two extensions but only one).

If we assume that each element in "causes" is a problem detail - then where is the type member? According to the RFC the type is "about:blank" if it is not specified. But then (according to the response of my other question https://github.com/ietf-wg-httpapi/rfc7807bis/issues/40 ) you can't define a custom extension for "about:blank".

If we would assume that the type of an "embedded" problem details is always the same as the one it is embedded then we assume something that is not part of the spec (or did I not see it?).

We could also say that the elements inside "causes" are not problem details but then we should remove the statement that the "example defines two extensions". It would only define ONE extension (the "causes").