Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.

[BUG] multipart/form-data Content-Disposition missing #66

Closed
3 of 6 tasks
spacether opened this issue Nov 3, 2022 · 0 comments · Fixed by #67
Closed
3 of 6 tasks

[BUG] multipart/form-data Content-Disposition missing #66

spacether opened this issue Nov 3, 2022 · 0 comments · Fixed by #67
Labels
bug Something isn't working
Milestone

Comments

@spacether
Copy link
Contributor

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
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

@spacether spacether added this to the 1.0.3 milestone Nov 3, 2022
@spacether spacether linked a pull request Nov 4, 2022 that will close this issue
3 tasks
@spacether spacether added the bug Something isn't working label Nov 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant