Skip to content

Wrong typings for default responses #16

Description

@gunzip

On this input

openapi: 3.0.0
info:
  title: Pet API
  version: 1.0.0
paths:
  /pet/{petId}:
    get:
      summary: Get pet by ID
      parameters:
        - name: petId
          in: path
          required: true
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  name:
                    type: string
        "404":
          description: Pet not found
        default:
          description: Unexpected error

cli generates

export type GetPetPetIdResponses =
  FullResponse<GetPetPetIdResponseOK, 200>
  | FullResponse<GetPetPetIdResponseNotFound, 404>
  | FullResponse<GetPetPetIddefaultResponse, default>
  //                            // ^? typescript error

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions