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

No Request parameter generated for requestBody with multipart/form-data #227

Open
olivergondza opened this issue Dec 8, 2021 · 2 comments

Comments

@olivergondza
Copy link

I am describing a schema for uploading files, and hence using multipart/form-data content type for requestBody. The generated function have no argument provided. Note that the request: Request is correctly generated for application/x-www-form-urlencoded content type.

paths:
  /foo:
    put:
      summary: Bar
        requestBody:
        content:
          "multipart/form-data":
            schema:
              type: object
              properties:
                metadata:
                  type: string
                  format: binary
                payload:
                  type: string
                  format: binary
@LongBeachHXC
Copy link
Contributor

I also need this functionality. My specific use case is allowing clients to upload a file. According to the fastapi docs here, it talks about using the UploadFile and File data types. The recommended approach is to use the UploadFile type.

This library does not yet support the multipart/form-data MIME type for a requestBody. @koxudaxi I'm attempting this but I'm realizing that not all use cases for multipart/form-data will be an UploadFile type. At this point, I'm not sure how to handle this but I'll give a try and see what I come up with.

@david-westreicher
Copy link
Contributor

Opened a PR for atleast supporting fileuploads with application/octet-stream content types. #313

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

3 participants