Swagger define default header value for a response in swagger.yaml

962 Views Asked by At

I'm using swagger-express-mw (swagger-node https://github.com/swagger-api/swagger-node) for api and I would like to set one header field to a specific value for all the api endpoints. Instead of setting it in code for each endpoint, I would like to do it through swagger. Is it possible to do it in swagger.yaml, or using some kind of an bagbike? If it is, then how? I have tried this but not working:

      responses:
        200:
          headers:
            pragma:
              type: string
              default: 'no-cache'

What I want is to set the headers pragma to default no-cache. Other headers (set by the app for example) should remain the same.

0

There are 0 best solutions below