Page Contents

Home > @loopback/rest > RestServer > addOpenApiSpecEndpoint

RestServer.addOpenApiSpecEndpoint() method

Add a new non-controller endpoint hosting a form of the OpenAPI spec.

Signature:

addOpenApiSpecEndpoint(path: string, form: OpenApiSpecForm, router?: express.Router): void;

Parameters

Parameter Type Description
path string Path at which to host the copy of the OpenAPI
form [OpenApiSpecForm](/doc/en/lb4/apidocs.rest.openapispecform.html) Form that should be rendered from that path
router express.Router _(Optional)_

Returns:

void