Skip to content

Commit

Permalink
Add webhooks to the model API
Browse files Browse the repository at this point in the history
  • Loading branch information
Azquelt committed May 16, 2024
1 parent 81a9613 commit 7a5fb71
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.eclipse.microprofile.openapi.models;

import java.util.List;
import java.util.Map;

import org.eclipse.microprofile.openapi.models.info.Info;
import org.eclipse.microprofile.openapi.models.security.SecurityRequirement;
Expand Down Expand Up @@ -275,6 +276,57 @@ default OpenAPI paths(Paths paths) {
return this;
}

/**
* Returns the webhooks property of this OpenAPI instance.
*
* @return a copy Map (potentially immutable) of named webhook definitions
* @since 4.0
*/
Map<String, PathItem> getWebhooks();

/**
* Sets the webhooks property of this OpenAPI instance.
*
* @param webhooks
* a map of named webhook definitions
* @since 4.0
*/
void setWebhooks(Map<String, PathItem> webhooks);

/**
* Sets the webhooks property of this OpenAPI instance.
*
* @param webhooks
* a map of named webhook definitions
* @return the current Schema instance
* @since 4.0
*/
default OpenAPI webhooks(Map<String, PathItem> webhooks) {
setWebhooks(webhooks);
return this;
}

/**
* Adds a webhook definition.
*
* @param name
* unique name of the webhook to add
* @param webhook
* webhook definition to add
* @return the current Schema instance
* @since 4.0
*/
OpenAPI addWebhook(String name, PathItem webhook);

/**
* Removes a webhook definition.
*
* @param name
* unique name of the webhook to remove
* @since 4.0
*/
void removeWebhook(String name);

/**
* Returns the components property from an OpenAPI instance.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@
* </pre>
*/

@org.osgi.annotation.versioning.Version("2.0")
@org.osgi.annotation.versioning.Version("2.1")
@org.osgi.annotation.versioning.ProviderType
package org.eclipse.microprofile.openapi.models;

0 comments on commit 7a5fb71

Please sign in to comment.