Skip to content

Customizer for @Webhooks #3056

@zdary

Description

@zdary

Is your feature request related to a problem? Please describe.
@webhooks are included in OpenAPI automatically without a possibility to exclude them from a group.

When multiple GroupedOpenApi are defined all Webhooks are included in all groups.
Some Webhooks are relevant for certain groups only.

Describe the solution you'd like

Allow customization over the Webhook inclusion.
i.e.

GroupedOpenApi.builder()
  .addOpenApiCustomizer(openApi -> {
    openApi.addWebhooksFromClass(MyWebhookDefinitions.class);
  })

the invocation of calculateWebhooks(openAPI, locale); method in AbstractOpenApiResource.getOpenApi method should be wrapped

if (springDocConfigProperties.isWebhookDetectionEnabled()) {
  calculateWebhooks(openAPI, locale);
}

Describe alternatives you've considered

I've tried to get into AbstractOpenApiResource.calculateWebhooks. That method is protected so customization is possible but not a clean solution.

thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions