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

fix for issue #13722: send body for application/x-www-form-urlencoded data #13723

Merged
merged 4 commits into from Oct 19, 2022

Conversation

davidchaiken
Copy link
Contributor

Fix for issue #13722: verified with successful calls to /v5/oauth/token endpoints for https://github.com/pinterest/api-description

@spacether

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    ./mvnw clean package 
    ./bin/generate-samples.sh
    ./bin/utils/export_docs_generators.sh
    
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    For Windows users, please run the script in Git BASH.
  • File the PR against the correct branch: master (6.1.0) (minor release - breaking changes with fallbacks), 7.0.x (breaking changes without fallbacks)
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

@spacether
Copy link
Contributor

spacether commented Oct 18, 2022

Hey there, thank you for your PR!
Unfortunately, this update broke the test_application_x_www_form_urlencoded_serialization test in node4.
Please fix it.
Please also add an api endpoint that sends and and possible receives application/x-www-form-urlencoded and assert that the request is called correctly and the response is what is expected. One can add a test that does that in the tests_manual directory.
Please see a similar-to test here: https://github.com/OpenAPITools/openapi-generator/blob/master/samples/openapi3/client/petstore/python/tests_manual/test_fake_api.py#L517
Please check PRs on those tests to see how to add endpoints to the sample spec.

@spacether spacether added this to the 6.2.1 milestone Oct 18, 2022
Copy link
Contributor

@spacether spacether left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see the comments for needed changes to get CI tests passing and add a verification endpoint test

@davidchaiken
Copy link
Contributor Author

add a verification endpoint test

As a newbie in this repo (and with the recent swap of python-experimental to python), I'm having a bit of trouble finding the right place to add a verification endpoint test. Can you recommend a file or directory where I should add the test and/or the command to run the test?

@spacether
Copy link
Contributor

spacether commented Oct 18, 2022

add a verification endpoint test

As a newbie in this repo (and with the recent swap of python-experimental to python), I'm having a bit of trouble finding the right place to add a verification endpoint test. Can you recommend a file or directory where I should add the test and/or the command to run the test?

Sure thing. Here are the steps:

  1. Please add an endpoint in this sample file which generates the python sample client
  2. Please regenerate the sample client with
./mvnw clean package 
./bin/generate-samples.sh
  1. Please add a manually written test of the new endpoint in this file

@davidchaiken
Copy link
Contributor Author

Thanks for the pointers. I added a verification endpoint test, but am not really happy with the assert_called_with in the new test. The assert_*_called_with functions in __init__.py didn't cover the parameters required to do this test, so I just called the lower-level function.

Also... Please let me know if you want me to have a look at using the fields option for urllib3. It's possible that I might be able to get it to work (but using fields will require changes over more code files).

Copy link
Contributor

@spacether spacether left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thank you for adding the test!

@spacether
Copy link
Contributor

CI failure is unrelated

@spacether
Copy link
Contributor

Also... Please let me know if you want me to have a look at using the fields option for urllib3. It's possible that I might be able to get it to work (but using fields will require changes over more code file

I wanted the fields removed from the call not used. No need to futz with it.

@spacether spacether merged commit c22715a into OpenAPITools:master Oct 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] python generator does not send body for application/x-www-form-urlencoded data
2 participants