Skip to content
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

OAS Templates - Schema field required for response object #24

Open
v-lui opened this issue Feb 4, 2020 · 1 comment
Open

OAS Templates - Schema field required for response object #24

v-lui opened this issue Feb 4, 2020 · 1 comment

Comments

@v-lui
Copy link

v-lui commented Feb 4, 2020

Hi,
In the API example templates (JSON and YAML, 2.0 and 3.0) from https://api.gov.au/standards/national_api_standards/getting-started.html#what-is-this-design-standard?
, error responses are defined thusly :-

responses: "200": $ref: "#/components/responses/200_error_response"
and
400_error_response: description: Bad Request. content: application/json: examples: response: value: > { "status": "400", "description": "The server cannot process the request.'The specified resource was not found.", "more_info": "" }
Note that "schema" field is missing. According to https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md, a missing schema field for response objects indicates there is no content returned as part of the response. As the example contains content, the schema field should be specified.

@rahariya
Copy link
Collaborator

rahariya commented Dec 4, 2020

@v-lui Schema field are not included as part of response. This is mentioned in the swagger specification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants