-
-
Notifications
You must be signed in to change notification settings - Fork 228
Serialize model query params #316
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
Changes from 2 commits
f5846ce
b405fce
147fe01
8b27773
284a750
8d6d644
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,7 @@ params: Dict[str, Any] = { | |
{% if property.required and not property.nullable %} | ||
params.update({{ property_name }}) | ||
{% else %} | ||
if {% if not property.required %}not isinstance({{ property_name }}, Unset){% endif %}{% if not property.required and property.nullable %} and {% endif %}{% if property.nullable %}{{ property_name }} is not None{% endif %}: | ||
if not isinstance({{ property_name }}, Unset) and {{ property_name }} is not None: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this was a mistake since now we get There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oops, yeah, probably a mistake from my merge. I think the two |
||
params.update({{ "json_" + property.python_name }}) | ||
{% endif %} | ||
{% endif %} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should probably also add
nullable
andnot required and nullable
examples as query params just to verify the template is working in all those cases using e2e tests.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dbanty Is it OK if I add that test coverage in #332? Since it's not possible AFAIK to make a nullable model query parameter without making it a union type, and if I make it a union type then it depends on #332.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep that's fine.