Skip to content

None is not correctly serialized for certain optional query params #380

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

Closed
forest-benchling opened this issue Apr 7, 2021 · 2 comments
Closed
Labels
🐞bug Something isn't working
Milestone

Comments

@forest-benchling
Copy link
Collaborator

Describe the bug
In #331, we decided to allow None to be passed in optional query params and treated identically to UNSET.

However, a few cases weren't supported:

  • model properties
  • enum properties
  • datetime properties

I haven't done an exhaustive search so there may be others as well; potentially any types that require non-trivial JSON serialization.

To Reproduce
This can already be seen in end_to_end_tests/golden-record/my_test_api_client/api/tests/defaults_tests_defaults_post.py:90, which will crash if None is passed in for the model.

Expected behavior
For all types, if the query param is optional, None is treated as UNSET.

OpenAPI Spec File
The existing openapi.json

Desktop (please complete the following information):

  • OS: [e.g. macOS 10.15.1]
  • Python Version: [e.g. 3.8.0]
  • openapi-python-client version [e.g. 0.1.0]

Additional context

@forest-benchling forest-benchling added the 🐞bug Something isn't working label Apr 7, 2021
@forest-benchling forest-benchling changed the title None is not correctly serialized for optional query params None is not correctly serialized for certain optional query params Apr 7, 2021
@forest-benchling
Copy link
Collaborator Author

cc @dtkav @bowenwr @packyg

dbanty added a commit that referenced this issue Aug 2, 2021
dbanty added a commit that referenced this issue Aug 7, 2021
@dbanty dbanty added this to the 0.10.2 milestone Aug 15, 2021
dbanty added a commit that referenced this issue Aug 15, 2021
dbanty added a commit that referenced this issue Aug 15, 2021
dbanty added a commit that referenced this issue Aug 15, 2021
dbanty added a commit that referenced this issue Aug 15, 2021
@dbanty
Copy link
Collaborator

dbanty commented Aug 15, 2021

Resolved in 0.10.2

@dbanty dbanty closed this as completed Aug 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants