class SwaggerModule {
static createDocument(app: INestApplication, config: Omit<OpenAPIObject, "paths">, options: SwaggerDocumentOptions = {}): OpenAPIObject
static loadPluginMetadata(metadataFn: () => Promise<Record<string, any>>)
protected static serveStatic(finalPath: string, app: INestApplication, customStaticPath?: string)
protected static serveDocuments(finalPath: string, urlLastSubdirectory: string, httpAdapter: HttpServer, documentOrFactory: OpenAPIObject | (() => OpenAPIObject), options: { ui: boolean; raw: boolean | ("json" | "yaml")[]; jsonDocumentUrl: string; yamlDocumentUrl: string; swaggerOptions: SwaggerCustomOptions; })
protected static serveSwaggerUi(finalPath: string, urlLastSubdirectory: string, httpAdapter: HttpServer, getBuiltDocument: () => OpenAPIObject, swaggerOptions: SwaggerCustomOptions)
protected static serveDefinitions(httpAdapter: HttpServer, getBuiltDocument: () => OpenAPIObject, options: { jsonDocumentUrl: string; yamlDocumentUrl: string; swaggerOptions: SwaggerCustomOptions; }, serveOptions: { serveJson: boolean; serveYaml: boolean; })
static setup(path: string, app: INestApplication, documentOrFactory: OpenAPIObject | (() => OpenAPIObject), options?: SwaggerCustomOptions)
}
Static methods
createDocument()
|
static createDocument(app: INestApplication, config: Omit<OpenAPIObject, "paths">, options: SwaggerDocumentOptions = {}): OpenAPIObject
Parameters
Returns
OpenAPIObject
|
|
static loadPluginMetadata(metadataFn: () => Promise<Record<string, any>>)
Parameters
Option |
Type |
Description |
metadataFn
|
() => Promise> |
|
|
serveStatic()
|
protected static serveStatic(finalPath: string, app: INestApplication, customStaticPath?: string)
Parameters
Option |
Type |
Description |
finalPath
|
string |
|
app
|
INestApplication |
|
customStaticPath
|
string |
Optional. Default is undefined .
|
|
serveDocuments()
|
protected static serveDocuments(finalPath: string, urlLastSubdirectory: string, httpAdapter: HttpServer, documentOrFactory: OpenAPIObject | (() => OpenAPIObject), options: { ui: boolean; raw: boolean | ("json" | "yaml")[]; jsonDocumentUrl: string; yamlDocumentUrl: string; swaggerOptions: SwaggerCustomOptions; })
Parameters
|
serveSwaggerUi()
|
protected static serveSwaggerUi(finalPath: string, urlLastSubdirectory: string, httpAdapter: HttpServer, getBuiltDocument: () => OpenAPIObject, swaggerOptions: SwaggerCustomOptions)
Parameters
|
serveDefinitions()
|
protected static serveDefinitions(httpAdapter: HttpServer, getBuiltDocument: () => OpenAPIObject, options: { jsonDocumentUrl: string; yamlDocumentUrl: string; swaggerOptions: SwaggerCustomOptions; }, serveOptions: { serveJson: boolean; serveYaml: boolean; })
Parameters
Option |
Type |
Description |
httpAdapter
|
HttpServer |
|
getBuiltDocument
|
() => OpenAPIObject |
|
options
|
object |
|
serveOptions
|
object |
|
|
setup()
|
static setup(path: string, app: INestApplication, documentOrFactory: OpenAPIObject | (() => OpenAPIObject), options?: SwaggerCustomOptions)
Parameters
|