Skip to content

basalt / fastify/src / generateOpenApi

Function: generateOpenApi() ​

> generateOpenApi(routes, info, tags?): JsonSchema

Defined in: http/src/openapi.ts:100

Builds an OpenAPI 3.0 document from Basalt route definitions.

Per-operation tags come from route.meta.tags; pass tags to add a top-level tags array (names + descriptions) that tools like Swagger UI use to order and describe the groups. Any tag used on an operation but missing from tags is still listed (name only), so groups are never dropped.

Parameters ​

routes ​

RouteLike[]

info ​

OpenApiInfo

tags? ​

OpenApiTag[] = []

Returns ​

JsonSchema

Released under the MIT License.