Skip to content

feat: add @ApiWebhook() for OAS 3.1 or later#3751

Open
undownding wants to merge 1 commit intonestjs:masterfrom
undownding:feat/api-webhook
Open

feat: add @ApiWebhook() for OAS 3.1 or later#3751
undownding wants to merge 1 commit intonestjs:masterfrom
undownding:feat/api-webhook

Conversation

@undownding
Copy link
Copy Markdown

@undownding undownding commented Feb 26, 2026

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior?

Issue Number: #1827

What is the new behavior?

Add a new decorator @ApiWebhook() for OAS 3.1 and later.

  @Controller()
  class StripeWebhooksController {
    @Post('stripe')
    @ApiWebhook('stripeEvent')
    stripe() {
      return { ok: true };
    }
  }

If document.openapi is set to default or 3.0.0, @ApiWebhook() will maintain the same output as before.

If document.openapi is set to 3.1.0 or later, the API will remove from document.paths and add to document.webhooks

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@kamilmysliwiec
Copy link
Copy Markdown
Member

Could you resolve conflicts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants