apiaryio / fury-adapter-swagger

Swagger 2.0 parser adapter for Fury.js
MIT License
11 stars 12 forks source link

Support multiple request headers #129

Closed honzajavorek closed 5 years ago

honzajavorek commented 7 years ago

There is no support for multiple response headers of the same name in Swagger 2.0, but there is a way how to have multiple request headers of the same name:

paths:
  /honey:
    get:
      parameters:
        - name: X-Multiple
          in: header
          x-example: foo
          type: string
        - name: X-Multiple
          in: header
          x-example: bar
          type: string

This syntax returns error though:

Validation failed. /paths/honey/get has duplicate parameters
Validation failed. Found multiple header parameters named "X-Multiple"

Related: https://github.com/OAI/OpenAPI-Specification/issues/1237

kylef commented 5 years ago

This is not permitted in the OpenAPI 2 spec:

The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a name and location.

You may do type: array though.