UNPKG

@loopback/docs

Version:

Documentation files rendered at [https://loopback.io](https://loopback.io)

36 lines (23 loc) 1.16 kB
--- lang: en title: 'API docs: openapi-spec-builder.operationspecbuilder.withresponse' keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI sidebar: lb4_sidebar editurl: https://github.com/strongloop/loopback-next/tree/master/packages/openapi-spec-builder permalink: /doc/en/lb4/apidocs.openapi-spec-builder.operationspecbuilder.withresponse.html --- <!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [@loopback/openapi-spec-builder](./openapi-spec-builder.md) &gt; [OperationSpecBuilder](./openapi-spec-builder.operationspecbuilder.md) &gt; [withResponse](./openapi-spec-builder.operationspecbuilder.withresponse.md) ## OperationSpecBuilder.withResponse() method Describe a response for a given HTTP status code. <b>Signature:</b> ```typescript 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 | <b>Returns:</b> this