Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/alosaur/openapi/builder/openapi-builder.ts>OpenApiBuilder

Alosaur - Deno web framework with many decorators
Go to Latest
class OpenApiBuilder
import { OpenApiBuilder } from "https://deno.land/x/alosaur@v0.34.0/openapi/builder/openapi-builder.ts";

Constructors

new
OpenApiBuilder(doc?: oa.OpenAPIObject)

Properties

rootDoc: oa.OpenAPIObject

Methods

addCallback(name: string, callback: oa.CallbackObject | oa.ReferenceObject): OpenApiBuilder
addContact(contact: oa.ContactObject): OpenApiBuilder
addDescription(description: string): OpenApiBuilder
addExample(name: string, example: oa.ExampleObject | oa.ReferenceObject): OpenApiBuilder
addExternalDocs(extDoc: oa.ExternalDocumentationObject): OpenApiBuilder
addHeader(name: string, header: oa.HeaderObject | oa.ReferenceObject): OpenApiBuilder
addInfo(info: oa.InfoObject): OpenApiBuilder
addLicense(license: oa.LicenseObject): OpenApiBuilder
addOpenApiVersion(openApiVersion: string): OpenApiBuilder
addParameter(name: string, parameter: oa.ParameterObject | oa.ReferenceObject): OpenApiBuilder
addPath(path: string, pathItem: oa.PathItemObject): OpenApiBuilder
addRequestBody(name: string, reqBody: oa.RequestBodyObject | oa.ReferenceObject): OpenApiBuilder
addResponse(name: string, response: oa.ResponseObject | oa.ReferenceObject): OpenApiBuilder
addSchema(name: string, schema: oa.SchemaObject | oa.ReferenceObject): OpenApiBuilder
addSecurityScheme(name: string, secScheme: oa.SecuritySchemeObject | oa.ReferenceObject): OpenApiBuilder
addServer(server: oa.ServerObject): OpenApiBuilder
addTag(tag: oa.TagObject): OpenApiBuilder
addTermsOfService(termsOfService: string): OpenApiBuilder
addTitle(title: string): OpenApiBuilder
addVersion(version: string): OpenApiBuilder
getSpec(): oa.OpenAPIObject
getSpecAsJson(replacer?: (key: string, value: any) => any, space?: string | number): string
getSpecAsYaml(): string

Static Methods

private
isValidOpenApiVersion(v?: string): boolean
create(doc?: oa.OpenAPIObject): OpenApiBuilder