|
22 | 22 | import org.eclipse.microprofile.openapi.annotations.OpenAPIDefinition;
|
23 | 23 | import org.eclipse.microprofile.openapi.annotations.callbacks.Callback;
|
24 | 24 | import org.eclipse.microprofile.openapi.annotations.callbacks.CallbackOperation;
|
| 25 | +import org.eclipse.microprofile.openapi.annotations.callbacks.Webhook; |
25 | 26 | import org.eclipse.microprofile.openapi.annotations.enums.ParameterIn;
|
26 | 27 | import org.eclipse.microprofile.openapi.annotations.enums.SchemaType;
|
27 | 28 | import org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeIn;
|
|
107 | 108 | extensions = @Extension(name = "x-server", value = "test-server")),
|
108 | 109 | @Server(url = "https://test-server.com:80/basePath", description = "The test API server")
|
109 | 110 | },
|
| 111 | + webhooks = { |
| 112 | + @Webhook(name = "bookingEvent", |
| 113 | + description = "Notifies about booking creation and deletion", |
| 114 | + summary = "Booking Events", |
| 115 | + operations = { |
| 116 | + @CallbackOperation(method = "put", |
| 117 | + summary = "Notifies that a booking has been created", |
| 118 | + requestBody = @RequestBody(content = @Content(mediaType = "application/json", |
| 119 | + schema = @Schema(ref = "#/components/schemas/Booking"))), |
| 120 | + responses = @APIResponse(responseCode = "204", |
| 121 | + description = "Indicates that the creation event was processed successfully")), |
| 122 | + @CallbackOperation(method = "delete", |
| 123 | + summary = "Notifies that a booking has been deleted", |
| 124 | + requestBody = @RequestBody(content = @Content(mediaType = "application/json", |
| 125 | + schema = @Schema(ref = "#/components/schemas/Booking"))), |
| 126 | + responses = @APIResponse(responseCode = "204", |
| 127 | + description = "Indicates that the deletion event was processed successfully")) |
| 128 | + }, |
| 129 | + extensions = @Extension(name = "x-webhook", value = "test-webhook")) |
| 130 | + }, |
110 | 131 | components = @Components(
|
111 | 132 | schemas = {
|
112 | 133 | @Schema(name = "Bookings", title = "Bookings",
|
|
0 commit comments