stoplightio / types

Common typings for the Stoplight ecosystem.
https://stoplight.io
Apache License 2.0
6 stars 9 forks source link

feat: callbacks support #54

Closed karol-maciaszek closed 5 years ago

karol-maciaszek commented 5 years ago

Introduces an IHttpOperation extension called IHttpCallbackOperation. The new interface carries additionally the name of callback operation.

The motivation behind extending the interface: callbacks in OASv3 spec are wrapped in an object with callback name as property and operation as value. SL's way of representing such objects is to convert it to an array and add a property inside with the key name (see operations array, examples array, etc.). This change is compatible with that approach.

Related PR: https://github.com/stoplightio/prism/pull/716 Related issue: https://github.com/stoplightio/prism/issues/331 The spec: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#callbackObject Callback example: https://github.com/OAI/OpenAPI-Specification/blob/master/examples/v3.0/callback-example.yaml

stoplight-bot commented 5 years ago

:tada: This PR is included in version 11.2.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: