Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

OpenAPIBuilder

import { OpenAPIBuilder } from "https://raw.githubusercontent.com/mandarineorg/mandarinets/master/mod.ts";
class OpenAPIBuilder {
constructor(docoument?: OpenAPISpec);
private document: OpenAPISpec;
private saveFilePath: string | URL | undefined;
 
public getInternalSaveFile(): string | URL | undefined;
public getSpec(): OpenAPISpec;
public setCallback(name: string, callback: OpenAPIPath | REF_OBJECT): OpenAPIBuilder;
public setContact(contact: OpenAPIContact): OpenAPIBuilder;
public setDescription(description: string): OpenAPIBuilder;
public setExample(name: string, example: OpenAPIExampleObject | REF_OBJECT): OpenAPIBuilder;
public setExternalDocs(extDoc: OpenAPIExternalDocumentationObject): OpenAPIBuilder;
public setHeader(name: string, header: OpenAPIHeaderObject | REF_OBJECT): OpenAPIBuilder;
public setInfo(info: OpenAPIInfo): OpenAPIBuilder;
public setInternalSaveFile(path: string | URL);
public setLicense(license: OpenAPILicense): OpenAPIBuilder;
public setLink(name: string, link: OpenAPILinkObject | REF_OBJECT): OpenAPIBuilder;
public setOpenAPIVersion(version: string): OpenAPIBuilder;
public setParameter(name: string, parameter: OpenAPIParameter | REF_OBJECT): OpenAPIBuilder;
public setPath(path: string, pathItem: OpenAPIPath): OpenAPIBuilder;
public setRequestBody(name: string, reqBody: OpenAPIRequestBody | REF_OBJECT): OpenAPIBuilder;
public setResponse(name: string, response: OpenAPIResponse | REF_OBJECT): OpenAPIBuilder;
public setSchema(name: string, schema: OpenAPISchemaObject | REF_OBJECT): OpenAPIBuilder;
public setSecurityScheme(name: string, secScheme: OpenAPISecuritySchemeObject | REF_OBJECT): OpenAPIBuilder;
public setServer(server: OpenAPIServer): OpenAPIBuilder;
public setTag(tag: OpenAPITagObject): OpenAPIBuilder;
public setTermsOfService(termsOfService: string): OpenAPIBuilder;
public setTitle(title: string): OpenAPIBuilder;
public setVersion(version: string): OpenAPIBuilder;
public toJSON(replacer?: (
this: any,
key: string,
value: any,
) => any
, space?: string | number): string;
public toYAML(): string;
}

§Constructors

§
new OpenAPIBuilder(docoument?: OpenAPISpec)
[src]

§Properties

§
document: OpenAPISpec
[src]
§
saveFilePath: string | URL | undefined
[src]

§Methods

§
getInternalSaveFile(): string | URL | undefined
[src]

Gets the file to be saved when document is complete. This method is only used internally by Mandarine

§
getSpec(): OpenAPISpec
[src]

Gets current Open API document as a javascript object

§
setCallback(name: string, callback: OpenAPIPath | REF_OBJECT): OpenAPIBuilder
[src]

Adds a new callback inside the components object in the Open API Document

§
setContact(contact: OpenAPIContact): OpenAPIBuilder
[src]

Sets the property contact inside the info object in the Open API Document

§
setDescription(description: string): OpenAPIBuilder
[src]

Sets the property description inside the info object in the Open API Document

§
setExample(name: string, example: OpenAPIExampleObject | REF_OBJECT): OpenAPIBuilder
[src]

Adds a new example inside the components object in the Open API Document

§
setExternalDocs(extDoc: OpenAPIExternalDocumentationObject): OpenAPIBuilder
[src]

Adds a new external documentation in the Open API Document

§
setHeader(name: string, header: OpenAPIHeaderObject | REF_OBJECT): OpenAPIBuilder
[src]

Adds a new header inside the components object in the Open API Document

§
setInfo(info: OpenAPIInfo): OpenAPIBuilder
[src]

Sets the property info in the Open API Document

§
setInternalSaveFile(path: string | URL)
[src]

Set file to be saved when document is complete. This method is only used internally by Mandarine

§
setLicense(license: OpenAPILicense): OpenAPIBuilder
[src]

Sets the property license inside the info object in the Open API Document

§
setOpenAPIVersion(version: string): OpenAPIBuilder
[src]

Sets a new Open API version to the document

§
setParameter(name: string, parameter: OpenAPIParameter | REF_OBJECT): OpenAPIBuilder
[src]

Adds a new parameter inside the components object in the Open API Document

§
setPath(path: string, pathItem: OpenAPIPath): OpenAPIBuilder
[src]

Adds a new path to the paths property in the Open API Document

§
setRequestBody(name: string, reqBody: OpenAPIRequestBody | REF_OBJECT): OpenAPIBuilder
[src]

Adds a new request body inside the components object in the Open API Document

§
setResponse(name: string, response: OpenAPIResponse | REF_OBJECT): OpenAPIBuilder
[src]

Adds a new response inside the components object in the Open API Document

§
setSchema(name: string, schema: OpenAPISchemaObject | REF_OBJECT): OpenAPIBuilder
[src]

Adds a new schema inside the components object in the Open API Document

§
setSecurityScheme(name: string, secScheme: OpenAPISecuritySchemeObject | REF_OBJECT): OpenAPIBuilder
[src]

Adds a new security schema inside the components object in the Open API Document

§
setServer(server: OpenAPIServer): OpenAPIBuilder
[src]

Adds a new server in the Open API Document

§
setTag(tag: OpenAPITagObject): OpenAPIBuilder
[src]

Adds a new tag in the Open API Document

§
setTermsOfService(termsOfService: string): OpenAPIBuilder
[src]

Sets the property termsOfService inside the info object in the Open API Document

§
setTitle(title: string): OpenAPIBuilder
[src]

Sets the property title inside the info object in the Open API Document

§
setVersion(version: string): OpenAPIBuilder
[src]

Sets the property version inside the info object in the Open API Document

§
toJSON(replacer?: (this: any, key: string, value: any) => any, space?: string | number): string
[src]

Gets current Open API Document as a JSON string

§
toYAML(): string
[src]

Gets current Open API Document as a YAML string