Skip to content

Support for wildcard HTTP responses #950

@torbjornsk

Description

@torbjornsk

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions