Skip to content

How should be specified a query/header parameter thats allow duplication #3031

Closed Answered by flaksp
joolfe asked this question in Q&A
Discussion options

You must be logged in to vote

"4.8.12.3 Style Values" section covers how parameters may be represented with different data types (also check out table with examples in "4.8.12.4 Style Examples" section below). It is possible to represent array of query-parameters as you wish with style: form, explode: true and using schema of type array in schema keyword.

Example:

name: color
in: query
style: form
explode: true
schema:
  type: array
  uniqueItems: true
  items:
    enum: [blue, black, brown]
color=blue&color=black&color=brown

However, OpenAPI specification does not cover multiple headers with same name, so behaviour is undefined 😔 But it's nice idea to visit "Big thoughts for 4.0" discussion where we gather ideas for…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@karenetheridge
Comment options

Answer selected by joolfe
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
param serialization Issues related to parameter and/or header serialization
4 participants