-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
validation error with example #11
Comments
Seems it was me doing it wrong. pet_client = PetStoreAPIClient(response_handler=JsonResponseHandler, request_formatter=JsonRequestFormatter)
result = pet_client.show_pet_by_id(petId="petid1") Would it be a good idea to modify the template to add None, validator, and **kwargs so the IDE doesn't give warnings? def show_pet_by_id(self, path_params: PetIdPathParams = ..., **kwargs) -> Pets:
"""Info for a specific pet"""
if not path_params:
raise RuntimeError("path_params are required")
return self.get(Endpoints.show_pet_by_id.format(**path_params)) |
Looks like flipping this to Then I can add Are there any downsides to doing this? |
I'm sorry, but I'm very busy this month. I'll be happy to look into this, but a little later. |
@mom1 no worries. I have it working how I want with local library edits. I just wanted to ensure I was following best practices and try to get things working how I want without the edits. |
Looks like it needs to be parametrized. |
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.
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.
The text was updated successfully, but these errors were encountered: