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

Support for wildcard HTTP responses #950

Open
torbjornsk opened this issue Sep 28, 2023 · 1 comment
Open

Support for wildcard HTTP responses #950

torbjornsk opened this issue Sep 28, 2023 · 1 comment
Labels
bug Something isn't working third-party Issue is in upstream third-party library

Comments

@torbjornsk
Copy link

torbjornsk commented Sep 28, 2023

As per the OpenAPI specification, it is allowed with wildcard http response codes (like 2xx, 3xx). Orval does not seem to support this.

https://learn.openapis.org/specification/paths.html#the-responses-object

What are the steps to reproduce this issue?

Given openapi-spec with wildcard response codes:

  /api/v1/users/me:
    get:
      tags:
      - user-resource
      summary: Fetch some metadata about the current logged in user
      operationId: getLoggedInUser
      responses:
        "2xx":
          description: Successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserDto'
        "4xx":
          description: Errors
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDto'

What happens?

Orval seems to fail with
#/paths/~1api~1v1~1users~1me/get/responses must NOT have additional properties

What were you expecting to happen?

Not failing, but rather support the wildcard http response codes.

What versions are you using?

Package Version: 6.17.0

@melloware
Copy link
Collaborator

Its a bug in Swagger Validator you can try it here youself: https://apitools.dev/swagger-parser/online/

I opened a ticket there: APIDevTools/swagger-parser#252

@melloware melloware added the third-party Issue is in upstream third-party library label Nov 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working third-party Issue is in upstream third-party library
Projects
None yet
Development

No branches or pull requests

2 participants