0

I am confused with swagger header definition. in the official document, it says that

Note: Header parameters named Accept, Content-Type and Authorization are not allowed. To describe these headers, use the corresponding OpenAPI keywords:

https://swagger.io/docs/specification/describing-parameters/#header-parameters

My header is below. Only contains "Content-type", "Accept", "Authorization" . Does that means I dont have to define the header in swagger under parameter since my header doesn't contain an unique custom value ?

content_headers_func_a = {
    "Content-type":"application/json",
    "Accept":"application/json",
    "Authorization" : "password"
    }
koukou
  • 1
  • 1
  • Yes, that's what the doc means. Note that the doc is for OpenAPI 3.0 (`openapi: 3.0.0`); if you use OpenAPI 2.0 (`swagger: '2.0'`) refer to this doc instead: https://swagger.io/docs/specification/2-0/describing-parameters/#header-parameters – Helen Jun 02 '20 at 11:55
  • Thank you for answering the question ! – koukou Jun 02 '20 at 11:57

0 Answers0