Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[python] Skip adding None value in query parameters #4161

Merged
merged 1 commit into from Oct 16, 2019
Merged

[python] Skip adding None value in query parameters #4161

merged 1 commit into from Oct 16, 2019

Conversation

ghost
Copy link

@ghost ghost commented Oct 15, 2019

If we send None for a non mandatory query parameter. OpenAPIGenerator now makes the URL something like ?query=None this should not be passed as the string None rather should be ignored as None is a special keyword

If the user passes the query as "None" (Str) only then url should be considered as ?query=None

fixes #4151

PR checklist

  • Read the contribution guidelines.
  • If contributing template-only or documentation-only changes which will change sample output, build the project before .
  • Run the shell script(s) under ./bin/ (or Windows batch scripts under.\bin\windows) to update Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit, and these must match the expectations made by your contribution. You only need to run ./bin/{LANG}-petstore.sh, ./bin/openapi3/{LANG}-petstore.sh if updating the code or mustache templates for a language ({LANG}) (e.g. php, ruby, python, etc).
  • File the PR against the correct branch: master, 4.1.x, 5.0.x. Default: master.
  • Copy the technical committee to review the pull request if your PR is targeting a particular programming language.

@ghost
Copy link
Author

ghost commented Oct 15, 2019

@taxpon (2017/07) @frol (2017/07) @mbohlool (2017/07) @cbornet (2017/09) @kenjones-cisco (2017/11) @tomplus (2018/10) @Jyhess (2019/01)

cc: @wing328

@wing328
Copy link
Member

wing328 commented Oct 15, 2019

LGMT. Let's wait for the CI test results.

@ghost
Copy link
Author

ghost commented Oct 15, 2019

👍

@ghost ghost changed the title Skip adding None value in query parameters [python] Skip adding None value in query parameters Oct 15, 2019
@wing328
Copy link
Member

wing328 commented Oct 16, 2019

CI failure not related to this PR.

@wing328 wing328 merged commit 1786e75 into OpenAPITools:master Oct 16, 2019
@wing328 wing328 added this to the 4.2.0 milestone Oct 16, 2019
@ghost ghost deleted the skip_adding_none_value_query_params branch October 16, 2019 07:41
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[REQ] [python] Optional query parameters
1 participant