In this PR I introduce a new parameter _content_type
to api calls and change select_header_content_type
to get access to the body of the request. It helps to set a valid content-type for sending requests in some cases. Current logic is the same, but the new method can be easily overridden/patched to perform better detection. What's more, users can force _content_type if necessary.
Context - some APIs (eg. kubernetes, https://github.com/kubernetes-client/python/pull/959, https://github.com/tomplus/kubernetes_asyncio/issues/68) define their own type of content-type (application/json-patch+json, application/strategic-merge-patch+json) where current logic doesn’t work and it’s very difficult to deal with it.
PR python-legacy
, I’ll prepare similar for python
later.
https://github.com/OpenAPITools/openapi-generator/issues/8116
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
./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
(5.3.0),6.0.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.
@taxpon (2017/07) @frol (2017/07) @mbohlool (2017/07) @cbornet (2017/09) @kenjones-cisco (2017/11) @tomplus (2018/10) @Jyhess (2019/01) @arun-nalla (2019/11) @spacether (2019/11), please take a look.
Thank you.