UNPKG

2.11 kBTypeScriptView Raw
1import * as yaml from 'yaml';
2import * as oa from '../model/openapi30';
3export declare class OpenApiBuilder {
4 rootDoc: oa.OpenAPIObject;
5 static create(doc?: oa.OpenAPIObject): OpenApiBuilder;
6 constructor(doc?: oa.OpenAPIObject);
7 getSpec(): oa.OpenAPIObject;
8 getSpecAsJson(replacer?: (key: string, value: unknown) => unknown, space?: string | number): string;
9 getSpecAsYaml(replacer?: Parameters<typeof yaml.stringify>[1], options?: Parameters<typeof yaml.stringify>[2]): string;
10 private static isValidOpenApiVersion;
11 addOpenApiVersion(openApiVersion: string): OpenApiBuilder;
12 addInfo(info: oa.InfoObject): OpenApiBuilder;
13 addContact(contact: oa.ContactObject): OpenApiBuilder;
14 addLicense(license: oa.LicenseObject): OpenApiBuilder;
15 addTitle(title: string): OpenApiBuilder;
16 addDescription(description: string): OpenApiBuilder;
17 addTermsOfService(termsOfService: string): OpenApiBuilder;
18 addVersion(version: string): OpenApiBuilder;
19 addPath(path: string, pathItem: oa.PathItemObject): OpenApiBuilder;
20 addSchema(name: string, schema: oa.SchemaObject | oa.ReferenceObject): OpenApiBuilder;
21 addResponse(name: string, response: oa.ResponseObject | oa.ReferenceObject): OpenApiBuilder;
22 addParameter(name: string, parameter: oa.ParameterObject | oa.ReferenceObject): OpenApiBuilder;
23 addExample(name: string, example: oa.ExampleObject | oa.ReferenceObject): OpenApiBuilder;
24 addRequestBody(name: string, reqBody: oa.RequestBodyObject | oa.ReferenceObject): OpenApiBuilder;
25 addHeader(name: string, header: oa.HeaderObject | oa.ReferenceObject): OpenApiBuilder;
26 addSecurityScheme(name: string, secScheme: oa.SecuritySchemeObject | oa.ReferenceObject): OpenApiBuilder;
27 addLink(name: string, link: oa.LinkObject | oa.ReferenceObject): OpenApiBuilder;
28 addCallback(name: string, callback: oa.CallbackObject | oa.ReferenceObject): OpenApiBuilder;
29 addServer(server: oa.ServerObject): OpenApiBuilder;
30 addTag(tag: oa.TagObject): OpenApiBuilder;
31 addExternalDocs(extDoc: oa.ExternalDocumentationObject): OpenApiBuilder;
32}