This is a suggestion for a feature request.
The current schema defines an errors array using a secondary error-item.yaml schema.
I suggest two changes:
- rename
errors to problems, since all errors are problems, but not all problems are errors. That is, this is application/problem+json not application/error+json
- instead of introducing another data models for the array items, just reuse (or extend) the existing schemas/problem-details.yaml schema.
- replace
code with type as in problem-details.yaml, for the same reason that type uses a URI and not just a string/code.
- replace
pointer and header and parameter with the instance property to be the uri-reference of the specific API request that has a problem. This can be a URN (a URN is one form of a URI); the prefix on the URN indicates what type of value the problem relates to, analogous to(but broader than) the in values for a parameter in OpenAPI. Values of in tell the recipient how to interpret or navigate the instance: URI. Values are body:, header:, path: and the remainder of the URN can be (in URN format) the values indicated for the existing pointer and header and parameter values in error-item.yaml.
If you like, I can draft a PR which more completely demonstrates this, with examples.
This is a suggestion for a feature request.
The current schema defines an
errorsarray using a secondary error-item.yaml schema.I suggest two changes:
errorstoproblems, since all errors are problems, but not all problems are errors. That is, this isapplication/problem+jsonnotapplication/error+jsoncodewithtypeas inproblem-details.yaml, for the same reason thattypeuses a URI and not just a string/code.pointerandheaderandparameterwith theinstanceproperty to be the uri-reference of the specific API request that has a problem. This can be a URN (a URN is one form of a URI); the prefix on the URN indicates what type of value the problem relates to, analogous to(but broader than) theinvalues for a parameter in OpenAPI. Values ofintell the recipient how to interpret or navigate theinstance:URI. Values arebody:,header:,path:and the remainder of the URN can be (in URN format) the values indicated for the existingpointerandheaderandparametervalues in error-item.yaml.If you like, I can draft a PR which more completely demonstrates this, with
examples.