[Bug][Python]Support body as bytes when Content-Type is unknown#2626
[Bug][Python]Support body as bytes when Content-Type is unknown#2626wing328 merged 3 commits intoOpenAPITools:masterfrom sarod:issue#2623
Conversation
There was a problem hiding this comment.
This comment should probably be updated but I'm not sure I understand the last part 'when body argument is provided in serialized form' so I chose to let it untouched for now.
There was a problem hiding this comment.
@sarod My "guess" is that the body can simply a string, e.g. "OK" or a boolean value (e.g. true), or just an integer, e.g. 2019.
Usually, the HTTP request body is JSON payload and I did see a few cases in which a string/number is used.
|
Travis CI reports errors partially shown below: Ref: https://travis-ci.org/OpenAPITools/openapi-generator/builds/517324159 |
What about updating the spec to specify the |
|
The spec in my issue uses openapi: 3.0.0 and specifies requestBody.content as a replacement of consumes. |
|
@wing328 All tests are passing now. |
|
@sarod 👍 If no one has further feedback on this PR, I'll merge it on coming Friday. |
fix #2623
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.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.Description of the PR
Accept body as bytes to support binary content types like application/octet-stream