Skip to content

Support for wildcard HTTP responses #950

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

Closed
torbjornsk opened this issue Sep 28, 2023 · 2 comments
Closed

Support for wildcard HTTP responses #950

torbjornsk opened this issue Sep 28, 2023 · 2 comments
Labels
third-party Issue is in upstream third-party library workaround A workaround has been provided

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
@melloware
Copy link
Collaborator

@torbjornsk i would just disable validation in Orval until this is fixed.

@melloware melloware added workaround A workaround has been provided and removed bug Something isn't working labels Mar 27, 2025
@melloware melloware closed this as not planned Won't fix, can't repro, duplicate, stale Mar 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
third-party Issue is in upstream third-party library workaround A workaround has been provided
Projects
None yet
Development

No branches or pull requests

2 participants