Closed itabrezshaikh closed 8 years ago
You need to set the collectionFormat.
- name: recipients[]
in: formData
description: Email addresses for recipients (multiple values allowed).
required: true
collectionFormat: multi
type: array
items:
type: string
I tried it but still it does not work. The ui still uses %2c (, comma) and not repeat the params. Below are the details:
* POST call made by swagger-ui * curl -X POST --header 'Content-Type: application/x-www-form-urlencoded' --header 'Accept: application/json' -d 'api_key=2b34032c39ea424f0aaf70ed060af428&from=test%40m3m.in&subject=test&content=test&footer=true&clicktrack=true&opentrack=true&recipients=itabrezshaikh%40gmail.com%2Ctazz.hunk%40gmail.com' 'http://b4f51651.ngrok.io/v1/emails.json'
Here is the new spec after change: http://pastebin.com/t47xjFQw
Hi,
Any help will be appreciated...thanks.
@itabrezshaikh I've opened a ticket in the relevant repo, will try to get to this shortly
Thank you @fehguy and @webron ..I will be waiting ..thanks a again :)
This is related to this issue I am having with TSV values. I believe the option multi is simply not implemented, have a look at the source code on lines 919 - 927 of operation.js. It also looks consistent with the behavior your seeing where it defaults to CSV.
Greetings Daniel
Is this problem fixed? I saw @fehguy fix it in swagger-js, but I don't know how to make swagger-ui work correclty
Ugh still not working... It seems project is dead. Last release was in January 7.
Please test master. Not dead, master has been active.
Yap still bugged.
* {
* "name": "players[]",
* "in": "formData",
* "description": "Players array, consisting of 11 player ids.",
* "required": true,
* "type": "array",
* "items": {
* "type":"integer"
* },
* "collectionFormat":"multi"
* }
produces csv
players%5B%5D=3197%2C3517%2C4506%2C4913%2C2798977%2C2799059%2C2799114%2C2799222%2C2799234%2C2799286%2C2799427
Same example working for query, but not for formData inside in parameter.
Done it via csv. Anyway ty for your work mate, no offense meant. ;)
I think you want to use collectionFormat: 'brackets'
instead, and use name: 'players'
(no []
)
multi - corresponds to multiple parameter instances instead of multiple values for a single instance foo=bar&foo=baz. This is valid only for parameters in "query" or "formData".
multi do not work in formData. What is meaning of brackets? I can't find it in specification
OK I believe brackets
live in implementation but not in the specification (came out after the spec was done). You can see how they work here:
I think you're right, formData does not support them. We can add it.
Thank you @fehguy
Hi,
I am trying to send multiple values (an array) (refer to on line 93 in spec ->... name: recipients[] ...)
The problem I am facing is the Swagger-ui call the endpoints as below:
Actual recipients[]=value1%2Cvalue2
Expected recipients[]=value1&recipients[]=value2
The %2C means , (comma).
Please help/guide, its urgent.
Thanks, Tabby
Below are the required details:
pepipost.dev.v4.yaml.txt