Skip to content

Commit

Permalink
fix: operation callbacks shape
Browse files Browse the repository at this point in the history
  • Loading branch information
danielgtaylor committed Dec 4, 2024
1 parent 4f98ee6 commit 375568c
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 375568c

Please sign in to comment.