Osvald Laurits
Osvald Laurits

Reputation: 1364

Swagger 2.0 Accept-Language header as request parameter

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?

Upvotes: 4

Views: 7344

Answers (1)

Helen
Helen

Reputation: 97677

Your definition is correct.

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

Upvotes: 2

Related Questions