Skip to content
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

Incorrect types cast #389

Open
EternalStuden1 opened this issue Dec 20, 2021 · 0 comments
Open

Incorrect types cast #389

EternalStuden1 opened this issue Dec 20, 2021 · 0 comments

Comments

@EternalStuden1
Copy link

EternalStuden1 commented Dec 20, 2021

Hi everyone.

I've had an experience with openapi module and it's perfect, good job!
But there is an issue that makes using openapi more complex - incorrect types casting when model field value is empty.
E.g. for any field with NUMBER type GET request will return false instead of null.
To fix that I propose to replase this code with the following:

result[field] = None if not value.id else value.id

In this case it will be possible to deserialize field value to corrent type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant