-
-
Notifications
You must be signed in to change notification settings - Fork 7k
[Python] serialize not respect type in model's openapi_types #11675
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
Comments
Have you tried using |
Any updates on the issue? |
This regression happens after #7965 If you looks at the method before the change happened, you can see:
Currently it is:
I assume it is because of optimizations are done and models are not imported by default (during init). |
This is fixed in v6.2.0 and onward |
Is your feature request related to a problem? Please describe.
I am generating client python code by swagger.json using openapi-generator-cli. To do that I used the
then it will gennerate
sanitize_for_serialization
function in api_client.py, which is like:This function will serialize a obj according to its actual type ,such as serialize a list obj to a list, but does not respect type in model's openapi_types. For example, we pass a list obj, but we want to serialize it to a string. We found that this function dose not use type in obj.openapi_types, is this expected?
Describe the solution you'd like
We want this function can serialize obj according to type in obj.openapi_types.
The text was updated successfully, but these errors were encountered: