openapi-python-client icon indicating copy to clipboard operation
openapi-python-client copied to clipboard

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

Open mymindwentblvnk opened this issue 3 months ago • 0 comments

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

mymindwentblvnk avatar Oct 10 '25 11:10 mymindwentblvnk