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

OpenAPI validation fails for range of response codes (4XX, 5XX, ...) #881

Closed
h6ah4i opened this issue Apr 16, 2024 · 1 comment · Fixed by #885
Closed

OpenAPI validation fails for range of response codes (4XX, 5XX, ...) #881

h6ah4i opened this issue Apr 16, 2024 · 1 comment · Fixed by #885
Labels
bug Something isn't working

Comments

@h6ah4i
Copy link
Contributor

h6ah4i commented Apr 16, 2024

In OpenAPI, we can describe response status codes like this.

      responses:
        '200':
          description: OK
        '4XX':
          description: Bad request.
        '5XX':
          description: Unexpected error.

The 4XX/5XX part is called range of response codes syntax in the OpenAPI spec and it is completely valid. However, runn gives error like the following;

Failure/Error: http request failed on "*** openapi3 validation error: Error: POST operation request response code '404' does not exist, Reason: The reponse code '404' of the POST request submitted has not been defined, it's an unknown type, Line: ***, Column: ***

ref.) https://swagger.io/docs/specification/describing-responses/

(I have not confirmed yet, but it seems pb33f/libopenapi does not support the syntax.)

@k1LoW
Copy link
Owner

k1LoW commented Apr 16, 2024

ref: pb33f/libopenapi-validator#65

k1LoW added a commit that referenced this issue Apr 21, 2024
@k1LoW k1LoW added the bug Something isn't working label Apr 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants