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:
How can I use the keyword produces to define an Accept-Language header?
Your definition is correct.
The page you mentioned talks about the Accept header, which is different from Accept-Language.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With