MCPcopy Create free account
hub / github.com/loopbackio/loopback-next / exportOpenApiSpec

Function exportOpenApiSpec

examples/lb3-application/src/openapi-spec.ts:12–23  ·  view source on GitHub ↗

* Export the OpenAPI spec from the application

()

Source from the content-addressed store, hash-verified

10 * Export the OpenAPI spec from the application
11 */
12async function exportOpenApiSpec(): Promise<void> {
13 const config: ApplicationConfig = {
14 rest: {
15 port: +(process.env.PORT ?? 3000),
16 host: process.env.HOST ?? 'localhost',
17 },
18 };
19 const outFile = process.argv[2] ?? '';
20 const app = new CoffeeShopApplication(config);
21 await app.boot();
22 await app.exportOpenApiSpec(outFile);
23}
24
25exportOpenApiSpec().catch(err => {
26 console.error('Fail to export OpenAPI spec from the application.', err);

Callers 1

openapi-spec.tsFile · 0.70

Calls 2

bootMethod · 0.65
exportOpenApiSpecMethod · 0.45

Tested by

no test coverage detected