script

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

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

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.

Where Next?

Popular in Questions Top

JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? Ecto.Repo — Ecto v3.14.0 has exampl...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New

Other popular topics Top

jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New

We're in Beta

About us Mission Statement