Page Contents
Home > @loopback/openapi-spec-builder > ComponentsSpecBuilder > withRequestBody
ComponentsSpecBuilder.withRequestBody() method
Define a component request body.
Signature:
withRequestBody(name: string, requestBody: RequestBodyObject | ReferenceObject): this;
Parameters
Parameter | Type | Description |
---|---|---|
name | string | The name of the request body |
requestBody | RequestBodyObject | ReferenceObject | Specification of the request body |
Returns:
this