swagger-api / swagger-api/swagger-codegen
[python] Support binary data in body
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
API expects data send as application/octet-stream in the body of the request.
Swagger-codegen version
latest, it has never been working.
Swagger declaration file content or url
There are body sanitization checks that do not allow application/octet-stream
Command line used for generation
java -jar swagger-codegen-latest.jar generate -i <path to openapi spec> -l python
Steps to reproduce
- Generate
api_client.pyandrest.pyas part ofgeneratecommand. - Try to use API that accepts
Content-Type: application/octet-streamand send data in body
Related issues/PRs
There is similar problem reported on JAVA language as well https://github.com/swagger-api/swagger-codegen/issues/669
Suggest a fix/enhancement
At the moment we don't have any working patch.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting the body sanitization checks in the generated api_client.py and rest.py files for the Python client. Reproduce the request with Content-Type application/octet-stream and binary body data; done means the generated client can send that body without the sanitization rejecting it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi, python
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100