Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File Upload http request is missing 'Content-Lenght' header #1488

Open
PiotrNestor opened this issue Dec 9, 2019 · 0 comments
Open

File Upload http request is missing 'Content-Lenght' header #1488

PiotrNestor opened this issue Dec 9, 2019 · 0 comments

Comments

@PiotrNestor
Copy link

No 'Content-Lenght' header is created by the Swagger Client when binary content upload.

If the 'Content-Lenght' is defined in the swagger definition and provided in the request, the file upload succeeds.

Q&A (please complete the following information)

  • OS: macOS
  • Environment: Node.js v12.5.0
  • Method of installation: npm
  • Swagger-Client version: 3.9.6
  • Swagger/OpenAPI version: OpenAPI 3.0

Content & configuration

Swagger/OpenAPI definition:

                "requestBody": {
                    "content": {
                        "application/offset+octet-stream": {
                            "schema": {
                                "format": "binary",
                                "type": "string"
                            }
                        }
                    },
                    "description": "The file content (binary) to upload",
                    "required": true
                },

Swagger-Client usage:

SwaggerClient({
  // your config options here
})

Describe the bug you're encountering

No 'Content-Lenght' header is created by the Swagger Client when binary content upload.

To reproduce...

Steps to reproduce the behavior:

  1. Create file upload request with binary content. Provide a stream object in the body.

Expected behavior

The file should be uploaded

Screenshots

Additional context or thoughts

If the 'Content-Lenght' is defined in the swagger definition and provided in the request, the file upload succeeds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant