script
Upload multiple files in swaggerUI
Currently my swagger is handling single file upload successfully. But I want to change it to accept multiple files but i can’t figure out a way how .
This is the working code:
Path.parameter(:file, :formData, :file, "Browse File", required: true)
Thanks!
First Post!
mbuhot
It looks like the swagger 2.0 spec allows for multiple form-data file parameters:
Multiple Upload
You can have several named file parameters, each defined individually:
parameters:
- in: formData
name: upfile1
type: file
required: true
- in: formData
name: upfile2
type: file
required: false
- in: formData
name: upfile3
type: file
required: false
However, uploading an arbitrary number of files (an array of files) is not supported. There is an open feature request at enable multiple file support? · Issue #254 · OAI/OpenAPI-Specification · GitHub. For now, you can use a binary string array as a workaround for uploading an arbitrary number of files:
Most Liked
mbuhot
Looks like it is available in OpenAPI 3.0 specification, but the swagger-ui part is still unimplemented.
You can check out OpenApiSpex project if you are looking to target OpenAPI 3.0.
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex










