swag-webhook-events/spec
Andrew Mayorov 6b8f234f01 CAPI-126: Redesign event definitions (#6)
* CAPI-126: Split long lines

* CAPI-126: Redesign event definitions

* CAPI-126: Fix spec build issues

* CAPI-126: Fix wording

* CAPI-126: Fix header name

* CAPI-126: Propose more general signature header

* CAPI-126: Make a couple of cosmetic fixes

* CAPI-126: Reflect topic in events

 * Do not discriminate between different topics, only invoices for now
 * Move invoice property up in the inheritance tree
2017-05-11 13:46:41 +03:00
..
code_samples Redoc ready fix (#2) 2017-04-25 17:44:38 +03:00
definitions CAPI-126: Redesign event definitions (#6) 2017-05-11 13:46:41 +03:00
paths CAPI-126: Redesign event definitions (#6) 2017-05-11 13:46:41 +03:00
README.md Redoc ready fix (#2) 2017-04-25 17:44:38 +03:00
swagger.yaml CAPI-126: Redesign event definitions (#6) 2017-05-11 13:46:41 +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"