Skip to main content

I have an API Specification designed in YAML using OAS 3.0.3. One field ex: customerId is defined as array of strings as below.

I want to pass comma separated values in the customerId field as part of query parameters. Ex: ?customerId='594918104','037833100','023135106'

That is the reason, style is set to "form" and explode to "false".

Reference from here: Describing Parameters (swagger.io)

name: customerId

in: query

description: Customer ID

required: false

schema:

type: array

items:

type: string

pattern: "^[A-Z0-9]+$"

minLength: 9

maxLength: 9

maxItems: 100

style: form

explode: false

example: ['594918104','037833100','023135106']

APIKit throws an error when I pass comma separated values in the customerId field. It works only if I repeat the query parameter name for each value. Same behavior when I test it using Mocking Service in Design Center.

ex: ?customerId=594918104&customerId=037833100&customerId=023135106

I do not want to repeat the key since the URL will get too long and it can potentially contain 100 values. That's why I am looking for passing the values with comma separated.

​Expected Behavior: ?customerId='594918104','037833100','023135106'

Appreciate for any help you can provide.

2 answers
  1. Apr 24, 2023, 3:43 PM

    thank you @Manish Yadav​ for checking.

0/9000