Multipart content types#2167
Open
rienafairefr wants to merge 5 commits intoOpenAPITools:masterfrom
Open
Conversation
edf04cd to
77278fe
Compare
6dbda0b to
140aff4
Compare
8a8af2a to
4cf1fd2
Compare
added 2 commits
June 7, 2019 12:37
test case for OAS3 multipart/ mixed request bodies
4cf1fd2 to
86f0a96
Compare
86f0a96 to
99ba1b6
Compare
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR checklist
./bin/to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.sh,./bin/openapi3/{LANG}-petstore.sh,./bin/security/{LANG}-petstore.shand./bin/openapi3/security/{LANG}-petstore.shif updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in.\bin\windows\.master,. Default:3.4.x,4.0.xmaster.@wing328 @kenjones-cisco @tomplus @Jyhess
Description of the PR
as described in #2165, the client doesnt handle well sending mixed-type multipart.
This PR adds support for the OAS3
encodingfield that can be found in the requestbody in the case of a multipart type:spect here, which is used to described the content type and headers of each multipart part (sic).
There is a possibility of multipart header parameters, because each multipart field can be added a
headersproperty that can be varied by the caller, so I've added amultipartHeaderParamsfield that can be used for that.I've implemented all this logic in the Python client. In the case of a
multipartoperation, instead ofpost_paramsbeing a list of simple(name, value)tuples, we can make complex cases by using urllib3RequestFielddirectlyI don't have an API that necessitates the variable header thing, but the mixed
Content-Typeare working fine. When using parameters that arefile, there still a bug the files are uploaded as string like<filename>,b'<binary-data>', but it's related to previously reported issue #2118