Skip to content

response codes 4XX, 5XX, etc result in NaN #332

@jayvdb

Description

@jayvdb

Describe the bug

https://swagger.io/docs/specification/v3_0/describing-responses/ describes 5XX as a valid definition of a response.

openapi-zod-client only accepts 'default' and specific response codes, and generates status: NaN for 5XX response code.

Minimal reproduction

The generated typescript includes

errors: [
{
    status: NaN,
    description: `unexpected error`,
    schema: ...
  },
]

Expected behavior

  • An entry in the errors array with a status of "5XX" or similar

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions