Swagger-UI: Posting array in formData (multipart/form-data)

49 views
Skip to first unread message

salv...@gmail.com

unread,
Jun 26, 2016, 3:22:41 AM6/26/16
to Swagger

Hello,


first of all, I want to thank you for your greate product.


I´am using swagger-ui version 2.1.4


I want to post an array with following configuration:


"name":"disease_ids",
"in":"formData",
"description":"disease_ids to add",
"type":"array",
"items":{
"type":"integer"
},
"collectionFormat":"multi"


Because I also want to post a file in this request I use "multipart/form-data":


The posted Data looks like the following (as you see the ids are concatenated):


-----------------------------29903252427366
Content-Disposition: form-data; name="allergy_ids"

allergy_ids=576720da3252bacc1c8f388f&allergy_ids=576721063252bacc1c8f3891
-----------------------------29903252427366
Content-Disposition: form-data; name="disease_ids"

disease_ids=5767958dce7fd3b428b8fac2&disease_ids=576795aace7fd3b428b8fac4


But I need the following format (produced with postman, with id´s as separeted values):


----WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="allergy_ids"

576720da3252bacc1c8f388f
----WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="allergy_ids"

576721063252bacc1c8f3891
----WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="disease_ids"

5767958dce7fd3b428b8fac2
----WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="disease_ids"

576795aace7fd3b428b8fac4


I would be appreciated if you could help me.


Thank you a lot !!!


Salvador

Tony Tam

unread,
Jun 26, 2016, 11:29:29 AM6/26/16
to swagger-sw...@googlegroups.com
Please try master, this should be fixed now
--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages