swag-url-shortener/spec
2017-12-19 14:10:35 +03:00
..
code_samples MSPF-321: Introduce swag proto for URL-shortener (#1) 2017-11-28 19:59:50 +03:00
definitions MSPF-320: Abandon inline schemas in order not to confuse generated client (#2) 2017-12-18 16:07:52 +03:00
paths MSPF-320: Explicitly allow 401s (#4) 2017-12-19 14:10:35 +03:00
README.md MSPF-321: Introduce swag proto for URL-shortener (#1) 2017-11-28 19:59:50 +03:00
swagger.yaml MSPF-320: Explicitly allow 401s (#4) 2017-12-19 14:10:35 +03:00

Global headers

In order to minimize duplications you can use headers global object (similar to definitions, responses). During build process all references to global headers will be inlined and headers will be removed form resulting spec so spec will be valid (global headers is not allowed by Swagger spec):

Example:

...
headers:
  Rate-Limit-Limit:
    description: The number of allowed requests in the current period
    type: integer
...
paths:
  /api-keys:
    get:
      summary: Retrieve a list of api keys
      responses:
        200:
          description: A list of api keys was retrieved successfully
          headers:
            Rate-Limit-Limit:
              $ref: "#/headers/Rate-Limit-Limit"