How to use the openapi3-ts.OpenApiBuilder.create function in openapi3-ts

To help you get started, we’ve selected a few openapi3-ts examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github plumier / plumier / packages / swagger / src / index.ts View on Github external
function transform(routes: RouteInfo[]) {
    const group = groupRoutes(routes)
    const paths = transformPaths(group)
    return OpenApiBuilder.create({
        openapi: "3.0.0",
        info: { title: "title", version: "1.0.0" },
        paths
    }).getSpec()
}
github djfdyuruiry / ts-lambda-api / src / api / open-api / OpenApiGenerator.ts View on Github external
private generateApiOpenApiSpecBuilder(appConfig: AppConfig, middlewareRegistry: MiddlewareRegistry) {
        let openApiBuilder = OpenApiBuilder.create()
        let paths: IDictionary = {}
        let tags: IDictionary = {}

        this.logger.debug("Generating OpenAPI spec")

        if (appConfig.name) {
            this.logger.trace("title: %s", appConfig.name)

            openApiBuilder.addTitle(appConfig.name)
        }

        if (appConfig.version) {
            this.logger.trace("version: %s", appConfig.version)

            openApiBuilder.addVersion(appConfig.version)
        }

openapi3-ts

TS Model & utils for OpenAPI 3.x specification.

MIT
Latest version published 2 months ago

Package Health Score

83 / 100
Full package analysis