Page Contents

Home > @loopback/openapi-spec-builder > OpenApiSpecBuilder > withOperation

OpenApiSpecBuilder.withOperation() method

Define a new OperationObject at the given path and verb (method).

Signature:

withOperation(verb: string, path: string, spec: OperationObject | OperationSpecBuilder): this;

Parameters

Parameter Type Description
verb string The HTTP verb.
path string The path relative to basePath.
spec OperationObject | OperationSpecBuilder Additional specification of the operation.

Returns:

this