Skip to content

Commit

Permalink
Merge pull request #665 from danielgtaylor/fix-callbacks
Browse files Browse the repository at this point in the history
fix: operation callbacks shape
  • Loading branch information
danielgtaylor authored Dec 4, 2024
2 parents 4f98ee6 + 375568c commit 4b4221f
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions openapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -938,8 +938,24 @@ type Operation struct {
// Callbacks is a map of possible out-of band callbacks related to the parent
// operation. The key is a unique identifier for the Callback Object. Each
// value in the map is a Callback Object that describes a request that may be
// initiated by the API provider and the expected responses.
Callbacks map[string]*PathItem `yaml:"callbacks,omitempty"`
// initiated by the API provider and the expected responses. The Callback
// Object consists of a map of possible request URL expressions to PathItem
// objects describing the request.
//
// callbacks:
// myName:
// '{$request.body#/url}':
// post:
// requestBody:
// description: callback payload
// content:
// application/json:
// schema:
// $ref: '#/components/schemas/SomePayload'
// responses:
// '200':
// description: callback response
Callbacks map[string]map[string]*PathItem `yaml:"callbacks,omitempty"`

// Deprecated declares this operation to be deprecated. Consumers SHOULD
// refrain from usage of the declared operation. Default value is false.
Expand Down

0 comments on commit 4b4221f

Please sign in to comment.