UNPKG

@loopback/docs

Version:

Documentation files rendered at [https://loopback.io](https://loopback.io)

36 lines (23 loc) 1.41 kB
--- lang: en title: 'API docs: rest.restserver.exportopenapispec' keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI sidebar: lb4_sidebar editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/rest permalink: /doc/en/lb4/apidocs.rest.restserver.exportopenapispec.html --- <!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [@loopback/rest](./rest.md) &gt; [RestServer](./rest.restserver.md) &gt; [exportOpenApiSpec](./rest.restserver.exportopenapispec.md) ## RestServer.exportOpenApiSpec() method Export the OpenAPI spec to the given json or yaml file **Signature:** ```typescript exportOpenApiSpec(outFile?: string, log?: (message?: any, ...optionalParams: any[]) => void): Promise<void>; ``` ## Parameters | Parameter | Type | Description | | --- | --- | --- | | outFile | string | _(Optional)_ File name for the spec. The extension of the file determines the format of the file. - <code>yaml</code> or <code>yml</code>: YAML - <code>json</code> or other: JSON If the outFile is not provided or its value is <code>''</code> or <code>'-'</code>, the spec is written to the console using the <code>log</code> function. | | log | (message?: any, ...optionalParams: any\[\]) =&gt; void | _(Optional)_ Log function, default to <code>console.log</code> | **Returns:** Promise&lt;void&gt;