This repository was archived by the owner on Dec 25, 2024. It is now read-only.
Description Bug Report Checklist
Description
When uploading a file with content type multipart/form-data the Content-Disposition part is missing.
Expected:
-----------------------------31264598498482450412031672804
Content-Disposition: form-data; name="file"; filename="test.txt"
Content-Type: text/plain
Hello World
-----------------------------31264598498482450412031672804--
Actual:
--3332f21c28498ce486e94b8ec5a48291
Content-Type: application/octet-stream
Hello World
--3332f21c28498ce486e94b8ec5a48291--
openapi-generator version
6.2.1
OpenAPI declaration file content or url
{
"openapi" : " 3.0.1" ,
"info" : {},
"servers" : [],
"security" : [],
"paths" : {
...,
"/files/{fileContainerId}/payload" : {
"post" : {
"tags" : [
" file"
],
"description" : " Upload a new file" ,
"operationId" : " createFile" ,
"parameters" : [
{
"name" : " fileContainerId" ,
"in" : " path" ,
"required" : true ,
"schema" : {
"type" : " integer" ,
"format" : " int64"
}
}
],
"requestBody" : {
"content" : {
"multipart/form-data" : {
"schema" : {
"required" : [
" file"
],
"type" : " object" ,
"properties" : {
"file" : {
"type" : " string" ,
"description" : " File which you want to upload" ,
"format" : " binary"
}
}
}
}
}
},
"responses" : {
"201" : {
"description" : " created"
},
"404" : {
"description" : " not found"
}
}
}
},
...
},
"components" : {... }
}
Generation Details
... generate -i target/openapi/openapi.json -g python -o clients/python
Steps to reproduce
Related issues/PRs
Suggest a fix
Note: duplicated from OpenAPITools/openapi-generator#13887
Reactions are currently unavailable
Bug Report Checklist
Description
When uploading a file with content type
multipart/form-datathe Content-Disposition part is missing.Expected:
Actual:
openapi-generator version
6.2.1
OpenAPI declaration file content or url
{ "openapi": "3.0.1", "info": {}, "servers": [], "security": [], "paths": { ..., "/files/{fileContainerId}/payload": { "post": { "tags": [ "file" ], "description": "Upload a new file", "operationId": "createFile", "parameters": [ { "name": "fileContainerId", "in": "path", "required": true, "schema": { "type": "integer", "format": "int64" } } ], "requestBody": { "content": { "multipart/form-data": { "schema": { "required": [ "file" ], "type": "object", "properties": { "file": { "type": "string", "description": "File which you want to upload", "format": "binary" } } } } } }, "responses": { "201": { "description": "created" }, "404": { "description": "not found" } } } }, ... }, "components": {...} }Generation Details
Steps to reproduce
Related issues/PRs
Suggest a fix
Note: duplicated from OpenAPITools/openapi-generator#13887