Page Contents

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

OperationSpecBuilder.withResponse() method

Describe a response for a given HTTP status code.

Signature:

withResponse(status: number | 'default', responseSpec: ResponseObject): this;

Parameters

Parameter Type Description
status number | 'default' HTTP status code or string “default”
responseSpec ResponseObject Specification of the response

Returns:

this