3

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.

Ville Miekk-oja
  • 18,749
  • 32
  • 70
  • 106

0 Answers0