Closed
Description
Describe the bug
The io.swagger.v3.oas.annotations.Webhook
has @Target({METHOD, ANNOTATION_TYPE})
/**
* The annotation may be used to define a method as an OpenAPI Webhook.
*
* @see <a target="_new" href="https://github.com/OAI/OpenAPI-Specification/blob/3.1.1/versions/3.1.1.md#oas-webhooks">Webhook (OpenAPI specification)</a>
* @see io.swagger.v3.oas.annotations.OpenAPIDefinition
**/
@Target({METHOD, ANNOTATION_TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Inherited
@OpenAPI31
public @interface Webhook {
/**
* Provides the name related to this webhook.
* @return webhook name
*/
String name();
/**
* Provides the operation related to this webhook.
* @return webhook operation
*/
Operation operation();
Which is a bit misleading because SpringDoc seems to be searching only for io.swagger.v3.oas.annotations.Webhooks
on the class level and never tries to resolve annotations on the method level.
To Reproduce
Steps to reproduce the behavior:
- Try to use
io.swagger.v3.oas.annotations.Webhook
on the method level, as per its target .
Expected behavior
- Either log a warning that the annotation should be on the class level or support them on the method level too.
Workaround
- Use
io.swagger.v3.oas.annotations.Webhooks
on class level on any Spring Bean and add the webhooks as its child (nested)io.swagger.v3.oas.annotations.Webhook
annotations.
Metadata
Metadata
Assignees
Labels
No labels