nori/request_body
RequestBody type for OpenAPI specifications.
Describes a request body for an operation.
Types
Describes a single request body.
pub type RequestBody {
RequestBody(
description: option.Option(String),
content: dict.Dict(String, parameter.MediaType),
required: option.Option(Bool),
extensions: dict.Dict(String, json.Json),
)
}
Constructors
-
RequestBody( description: option.Option(String), content: dict.Dict(String, parameter.MediaType), required: option.Option(Bool), extensions: dict.Dict(String, json.Json), )Arguments
- description
-
A brief description of the request body.
- content
-
The content of the request body, keyed by media type.
- required
-
Determines if the request body is required in the request.
- extensions
-
Extension fields (x-*)
Values
pub fn required_with_content(
content_type: String,
media_type: parameter.MediaType,
) -> RequestBody
Creates a required RequestBody with a single content type.
pub fn with_content(
content_type: String,
media_type: parameter.MediaType,
) -> RequestBody
Creates a RequestBody with a single content type.