Annotation Type RequestBody
-
@Target({PARAMETER,METHOD}) @Retention(RUNTIME) @Inherited public @interface RequestBody
Describes a single request body.
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description Content[]contentThe content of the request body.StringdescriptionA brief description of the request body.Extension[]extensionsList of extensions to be added to theRequestBodymodel corresponding to the containing annotation.StringnameThe unique name to identify this request body.StringrefReference value to a RequestBody object.booleanrequiredDetermines if the request body is required in the request.
-
-
-
Element Detail
-
description
String description
A brief description of the request body.This could contain examples of use. CommonMark syntax MAY be used for rich text representation.
- Returns:
- description of this requestBody instance
- Default:
- ""
-
-
-
content
Content[] content
The content of the request body. It is a REQUIRED property unless this is only a reference to a request body instance.- Returns:
- content of this requestBody instance
- Default:
- {}
-
-
-
required
boolean required
Determines if the request body is required in the request.Note that the default value of this property is
true, while the default value of therequiredproperty in the OpenAPI specification isfalse, because Jakarta REST resource methods which accept a request body generally require it.- Returns:
- whether or not this requestBody is required
- Default:
- true
-
-
-
name
String name
The unique name to identify this request body. Unless this annotation is used on the actual request body parameter, it is required to match the name of that parameter so the appropriate association can be made. When the request body is defined withinComponents. The name will be used as the key to add this request body to the 'requestBodies' map for reuse.- Returns:
- this request body's name
- Default:
- ""
-
-
-
ref
String ref
Reference value to a RequestBody object.This property provides a reference to an object defined elsewhere. This property may be used with
description()but is mutually exclusive with all other properties. If properties other thandescriptionare defined in addition to therefproperty then the result is undefined.- Returns:
- reference to a request body
- Default:
- ""
-
-
-
extensions
Extension[] extensions
List of extensions to be added to theRequestBodymodel corresponding to the containing annotation.- Returns:
- array of extensions
- Since:
- 3.1
- Default:
- {}
-
-