Skip to content

validation error with example #11

@brunnels

Description

@brunnels

Not certain if it's an issue with python 3.10 or not but I always get a validation error with your example and also the code that is generated from my openapi doc.

I copy/pasted from the README.md to create the PetStoreAPIClient.

    pet_client = PetStoreAPIClient(response_handler=JsonResponseHandler, request_formatter=JsonRequestFormatter)
    params = PetIdPathParams(petId="petid1")
    result = pet_client.show_pet_by_id(path_params=params)
    print(result)

(<class 'pydantic.error_wrappers.ValidationError'>, ValidationError(model='ParsingModel[PetIdPathParams]', errors=[{'loc': ('__root__', 'petId'), 'msg': 'field required', 'type': 'value_error.missing'}]), <traceback object at 0x7f2c6db4d980>)

Looks like it's happening around line 36 of https://github.com/mom1/api-client-pydantic/blob/main/apiclient_pydantic/serializers.py but I can't determine if I'm doing something wrong with the generated client, it's py 3.10 compatibility issue, or something is broken in the api-client-pydantic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions