openapi-generator icon indicating copy to clipboard operation
openapi-generator copied to clipboard

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

Open davidchaiken opened this issue 3 years ago • 2 comments

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

@spacether

PR checklist

  • [x] Read the contribution guidelines.
  • [x] 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.
  • [x] 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.
  • [x] File the PR against the correct branch: master (6.1.0) (minor release - breaking changes with fallbacks), 7.0.x (breaking changes without fallbacks)
  • [x] If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

davidchaiken avatar Oct 18 '22 01:10 davidchaiken

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 avatar Oct 18 '22 01:10 spacether

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?

davidchaiken avatar Oct 18 '22 17:10 davidchaiken

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

spacether avatar Oct 18 '22 19:10 spacether

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).

davidchaiken avatar Oct 18 '22 22:10 davidchaiken

CI failure is unrelated

spacether avatar Oct 19 '22 01:10 spacether

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 avatar Oct 19 '22 01:10 spacether