-
Notifications
You must be signed in to change notification settings - Fork 5
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
Problem type example could be less specific #7
Comments
Discussed in WG: OK to change the problem example. Having a response for status 500 when specifying generic Problem type for a 4xx code may be confusing as well. To try out if it's possible to override example per explicit response status code; and if it's manageable. If not we can fall back to a generic example problem type that's clearly not used in practice. |
We could also add a link in the OpenAPI documentation of a Problem or ProblemResponse to the standardized belgif URNs on https://www.belgif.be/specification/rest/api-guide/#standardized-problem-types . Alternatively, in OpenAPI 3, examples could be added for each of these types, but this would become more difficult to maintain. |
Example from schema can be overridden in response object: "409":
description: Conflict
content:
application/problem+json:
schema:
$ref: "./types.yaml#/components/schemas/Problem"
example: {
"custom": "example"
} However, it cannot be overridden when $ref-fing the response object:
PR created for more generic examples: https://github.com/belgif/openapi-problem/pull/13/files |
Reviewed by WG. Some changes will be made. "type": "urn:problem-type:exampleOrganization:exampleProblem", #exampleOrganization should be the organization that defines the problem type. "belgif" is used for problem types standardized in the Belgif REST guide
"href": "..." # should refer to documentation of the problem type, either a belgif standardized problem, or to documentation of a custom problem type In input validation issue, add comment "additional properties are allowed" move the input validation issue with replaced ssin to example of InputValidationProblem in the REST guide, in order to show an example with additional properties |
#13 for openapi-problem adapted and ready for last review pass. belgif/rest-guide#155 also ready for review:
|
changes merged, I'll create a patch release |
Often, a default problem response will be added to REST API's, referencing the belgif/problem/v1/problem-v1.yaml#/components/responses/ProblemResponse type.
In the generated swagger doc this becomes:
This example feels a bit out of place, as it is a very specific type of problem.
An alternative more generally applicable example could be:
The text was updated successfully, but these errors were encountered: