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 arrays are broken for multipart forms #5396

Closed
nigredo-tori opened this issue Jun 11, 2019 · 1 comment
Closed

File arrays are broken for multipart forms #5396

nigredo-tori opened this issue Jun 11, 2019 · 1 comment

Comments

@nigredo-tori
Copy link

nigredo-tori commented Jun 11, 2019

Q&A (please complete the following information)

  • OS: Ubuntu 18.10
  • Browser: Chrome
  • Version: 74.0.3729.169
  • Method of installation: dist asset link (unpkg.com)
  • Swagger-UI version:
  • Swagger/OpenAPI version: OpenAPI 3.0.2

Content & configuration

Example Swagger/OpenAPI definition:

openapi: 3.0.2
info:
  title: foo
  version: "0.1"
servers:
  - url: http://localhost:4444
paths:
  /test:
    post:
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                foo:
                  type: array
                  items:
                    type: string
                    format: binary
      responses:
        '200':
          description: baz

Swagger-UI configuration options:

SwaggerUIBundle({
  url: "openapi.yaml",
  dom_id: '#swagger-ui',
  deepLinking: true,
  presets: [
    SwaggerUIBundle.presets.apis,
    SwaggerUIStandalonePreset
  ],
  plugins: [
    SwaggerUIBundle.plugins.DownloadUrl,
    HideTopbarPlugin
  ],
  layout: "StandaloneLayout",
})

Describe the bug you're encountering

A multipart property defined like this:

foo:
   type: array
   items:
     type: string
     format: binary

To reproduce...

Steps to reproduce the behavior:

  1. Go to https://editor.swagger.io .
  2. Paste the OpenAPI config from above.
  3. Start capturing the request via Wireshark (loopback, port 4444 - as defined in the config).
  4. Open the POST test tab.
  5. Press "Try it out".
  6. Add a few files to the array.
  7. Press "Execute".
  8. See in the Wireshark that the request looks like the example above.

Expected behavior

Produced multipart request should have one part per file in array, containing the data from the corresponding file.

Additional context or thoughts

File arrays are described here.

@nigredo-tori
Copy link
Author

Nevermind, this is a duplicate of #4600

@lock lock bot locked and limited conversation to collaborators Jun 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant