You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched existing issues to ensure the feature has not already been requested
🚀 Feature Proposal
OpenAPI 3.1 has a concept of webhooks. It's similar to callbacks, but in webhooks, the API initiates the request. It's not an async response to the client's request.
Currently, Fastify Swagger doesn't support this feature.
Motivation
It's part of the OpenAPI 3.1 specification and it gives a lot of context for the API clients.
Example
Defining the schema:
awaitapp.register(FastifySwagger,{openapi: {openapi: '3.1.0',info: {title: 'Fastify Project',description: 'Fastify Project',version: '0.0.0',},webhooks: {newPet: {post: {requestBody: {description: 'Pet to add to the store',content: {'application/json': {schema: {$ref: '#/components/schemas/NewPet',},},},},responses: {'200': {description: 'OK',},},},},},},});
Should generate this OpenAPI specification:
openapi: 3.1.0info:
title: Fastify Projectdescription: Fastify Projectversion: 0.0.0components:
schemas: {}webhooks:
newPet:
post:
description: Pet to add to the storerequestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Pet'responses:
'200':
description: OK
The text was updated successfully, but these errors were encountered:
Prerequisites
🚀 Feature Proposal
OpenAPI 3.1 has a concept of webhooks. It's similar to callbacks, but in webhooks, the API initiates the request. It's not an async response to the client's request.
Currently, Fastify Swagger doesn't support this feature.
Motivation
It's part of the OpenAPI 3.1 specification and it gives a lot of context for the API clients.
Example
Defining the schema:
Should generate this OpenAPI specification:
The text was updated successfully, but these errors were encountered: