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

support for array of objects containing both file and text fields #9

Open
pratik149 opened this issue Dec 11, 2024 · 1 comment
Open

Comments

@pratik149
Copy link

Thank you @FlameWolf for this library.

I was wondering if it is at all possible to send an array of objects in the request body where an object may contain both file fields and text fields?

Following is an example OpenAPI spec request.

  /s3-upload-documents:
    post:
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                documents:
                  type: array
                  items:
                    type: object
                    required:
                      - document
                      - documentType
                      - isPublic
                    properties:
                      document:
                        type: object
                        format: binary
                      documentType:
                        type: string
                      isPublic:
                        type: string
      responses:
        '201':
          description: File uploaded successfully

Below is the Postman request where I'm attempting to send an array of objects but I'm not getting the desired response from it after returning req.body from an api built using fastify and formzilla lib. I was expecting an array of objects but it is simply returning key-value pairs.

image
@FlameWolf
Copy link
Owner

Hi Prateek, currently this functionality is not supported, but I will see if it can be implemented. Can you share a sample repo with a mock implementation of your /s3-upload-documents endpoint?

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

2 participants