Page Contents

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

OperationSpecBuilder class

A builder for creating OperationObject specifications.

Signature:

export declare class OperationSpecBuilder extends BuilderBase<OperationObject> 

Constructors

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

Methods

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.
withRequestBody(requestBodySpec)    
withResponse(status, responseSpec)   Describe a response for a given HTTP status code.
withStringResponse(status)    
withTags(tags)   Describe tags associated with the operation