Class RequestBodyInfo
The Request Body Object describes a single request body that can be sent to an API operation. It includes a description, whether the request body is required, and the content (media types) that the request body can contain.
OpenAPI Specification:
The Request Body Object is composed of the following fields:
description (string) - A brief description of the request body (CommonMark syntax may be used)content (map ofMediaType, REQUIRED) - The content of the request body (keys are media types)required (boolean) - Determines if the request body is required in the request (default isfalse )
Example:
See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.RequestBodyInfo(RequestBodyInfo copyFrom) Copy constructor. -
Method Summary
Modifier and TypeMethodDescriptionaddContent(String key, MediaType value) Adds one or more values to thecontent property.copy()Make a deep copy of this object.<T> TGeneric property getter.Bean property getter:content .Bean property getter:description .Bean property getter:required .keySet()Returns all the keys on this element.Generic property setter.setContent(Map<String, MediaType> value) Bean property setter:content .setDescription(String value) Bean property setter:description .setRequired(Boolean value) Bean property setter:required .protected RequestBodyInfostrict()Sets strict mode on this bean.Sets strict mode on this bean.
-
Constructor Details
-
RequestBodyInfo
public RequestBodyInfo()Default constructor. -
RequestBodyInfo
Copy constructor.- Parameters:
copyFrom- The object to copy.
-
-
Method Details
-
addContent
Adds one or more values to thecontent property.- Parameters:
key- The mapping key. Must not benull , or anIllegalArgumentExceptionis thrown.value- The values to add to this property.
Must not benull , or anIllegalArgumentExceptionis thrown.
Ignored ifnull .- Returns:
- This object
-
copy
Make a deep copy of this object.- Returns:
- A deep copy of this object.
-
get
Description copied from class:OpenApiElementGeneric property getter.Can be used to retrieve non-standard Swagger fields such as
"$ref" .- Overrides:
getin classOpenApiElement- Type Parameters:
T- The datatype to cast the value to.- Parameters:
property- The property name to retrieve.type- The datatype to cast the value to.- Returns:
- The property value, or
null if the property does not exist or is not set.
-
getContent
Bean property getter:content .- Returns:
- The property value, or
null if it is not set.
-
getDescription
Bean property getter:description .A brief description of the request body.
- Returns:
- The property value, or
null if it is not set.
-
getRequired
Bean property getter:required .Determines if the request body is required in the request.
- Returns:
- The property value, or
null if it is not set.
-
keySet
Description copied from class:OpenApiElementReturns all the keys on this element.- Overrides:
keySetin classOpenApiElement- Returns:
- All the keys on this element.
Nevernull .
-
set
Description copied from class:OpenApiElementGeneric property setter.Can be used to set non-standard Swagger fields such as
"$ref" .- Overrides:
setin classOpenApiElement- Parameters:
property- The property name to set. Must not benull , or anIllegalArgumentExceptionis thrown.value- The new value for the property.- Returns:
- This object
-
setContent
Bean property setter:content .- Parameters:
value- The new value for this property.
Can benull to unset the property.- Returns:
- This object
-
setDescription
Bean property setter:description .A brief description of the request body.
- Parameters:
value- The new value for this property.
Can benull to unset the property.- Returns:
- This object
-
setRequired
Bean property setter:required .Determines if the request body is required in the request.
- Parameters:
value- The new value for this property.
Can benull to unset the property.- Returns:
- This object
-
strict
Description copied from class:OpenApiElementSets strict mode on this bean.- Overrides:
strictin classOpenApiElement- Parameters:
value- The new value for this property.
Non-boolean values will be converted to boolean usingBoolean..valueOf (value.toString())
Can benull (interpreted asfalse ).- Returns:
- This object
-
strict
Description copied from class:OpenApiElementSets strict mode on this bean.- Overrides:
strictin classOpenApiElement- Returns:
- This object
-