Nexmo / oas_parser

An open source Open API Spec 3 Definition Parser
MIT License
51 stars 16 forks source link

Add support for OAS 3.1 compatible webhooks #48

Closed mheap closed 4 years ago

mheap commented 4 years ago

OAS 3.1 adds a new webhooks section at the top level that is identical to paths, with the caveat that instead of a /path we have a webhook-name. The objects contained within are standard Path Item objects

This commit adds #webhooks to the Definition class to return a list of webhooks. This list contains Webhook objects that inherit from Path and add a single new method, #name which calls #path internally

Official example: https://github.com/OAI/OpenAPI-Specification/blob/v3.1.0-dev/examples/v3.1/webhook-example.yaml

Official docs: https://github.com/OAI/OpenAPI-Specification/blob/v3.1.0-dev/versions/3.1.0.md#fixed-fields