Page Contents

Home > @loopback/openapi-spec-builder > OperationSpecBuilder

OperationSpecBuilder class

A builder for creating OperationObject specifications.


export declare class OperationSpecBuilder extends BuilderBase<OperationObject> 


Constructor Modifiers Description
(constructor)()   Constructs a new instance of the OperationSpecBuilder class


Method Modifiers Description
withControllerName(name)   Define the controller name (controller name).
withOperationId(operationId)   Define the operationId
withOperationName(name)   Define the operation name (controller method name).
withParameter(parameterSpecs)   Describe one more parameters accepted by the operation. Note that parameters are positional in OpenAPI Spec, therefore the first call of withParameter defines the first parameter, the second call defines the second parameter, etc.
withResponse(status, responseSpec)   Describe a response for a given HTTP status code.
withTags(tags)   Describe tags associated with the operation