For an api with this format: GET /resource?param=value1¶m=value2¶m=value3
In open Api 2.0, we can specify like this:
parameters:
- in: query
name: color
type: array
collectionFormat: multi
items:
type: string
But in v3.0 attribute collectionFormat is not available. So while trying with collectionFormat, I received error saying should not have additional property: collectionFormat
.
I have searched the documentation but can't find any answer. Does anyone have any idea what should be the new implementation to migrate from 2.0 to 3.0 version?
You should use style
and explode
properties instead:
- name: param
in: query
description: Id description
required: false
style: form
explode: true
schema:
type: array
items:
type: string
where
explode: true
will form param=abc¶m=xyz etc
andexplode: false
will form param=abc,xyzReferences:
collectionFormat
property, which has been replaced in the new version of the specification by the style
property)