3

I'm writing a specification for a http API using Swagger 2.0.

How can I define the Accept-Language header as a required header parameter for a path?

/aPath:
post:
  parameters:
    - in: header
      name: Accept-Language
      type: string
      enum: [de, en, es]
      required: true
  responses:
    200:
      description: The Best
      schema:
        type: string

Documentation on header parameters says

Swagger specification has special keywords for some headers: enter image description here

How can I use the keyword produces to define an Accept-Language header?

Osvald Laurits
  • 1,228
  • 2
  • 17
  • 32

1 Answers1

2

Your definition is correct.

The page you mentioned talks about the Accept header, which is different from Accept-Language.

Helen
  • 87,344
  • 17
  • 243
  • 314