Skip to content

Input should be a valid string for integer keys in openapi.yaml #1333

@mymindwentblvnk

Description

@mymindwentblvnk

Describe the bug
When generating classes from openapi.yaml with integers as keys (e.g. 200), I get the error:

paths./api/events.get.responses.200.[key]
  Input should be a valid string [type=string_type, input_value=200, input_type=int]
    For further information visit https://errors.pydantic.dev/2.12/v/string_type

Is there a chance to ignore those errors and fall back to string for integer keys?

OpenAPI Spec File
Link to an OpenAPI document

Desktop (please complete the following information):

  • OS: macOS 26.0.1
  • Python Version: 13.3
  • openapi-python-client version: 0.26.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions