Top Description Methods
org.eclipse.microprofile.openapi.annotations.parameters

public @Interface RequestBody

extends Annotation
Annotations
@Target:PARAMETER, METHOD
@Retention:RUNTIME
@Inherited
Imports
java.lang.annotation.ElementType, .Inherited, .Retention, .RetentionPolicy, .Target, org.eclipse.microprofile.openapi.annotations.extensions.Extension, org.eclipse.microprofile.openapi.annotations.media.Content

Describes a single request body.
See Also
OpenAPI Specification Request Body Object

Method Summary

Modifier and TypeMethod and Description
public Content[]

Returns:

content of this requestBody instance
content
()

The content of the request body.

public String

Returns:

description of this requestBody instance
description
()

A brief description of the request body.

public Extension[]

Returns:

array of extensions
extensions
()

List of extensions to be added to the RequestBody model corresponding to the containing annotation.

public String

Returns:

this request body's name
name
()

The unique name to identify this request body.

public String

Returns:

reference to a request body
ref
()

Reference value to a RequestBody object.

public boolean

Returns:

whether or not this requestBody is required
required
()

Determines if the request body is required in the request.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

contentback to summary
public 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[]

content of this requestBody instance

descriptionback to summary
public 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:String

description of this requestBody instance

extensionsback to summary
public Extension[] extensions()

List of extensions to be added to the RequestBody model corresponding to the containing annotation.

Returns:Extension[]

array of extensions

Since
3.1
nameback to summary
public 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 within org.eclipse.microprofile.openapi.annotations.Components. The name will be used as the key to add this request body to the 'requestBodies' map for reuse.

Returns:String

this request body's name

refback to summary
public 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 than description are defined in addition to the ref property then the result is undefined.

Returns:String

reference to a request body

requiredback to summary
public 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 the required property in the OpenAPI specification is false, because Jakarta REST resource methods which accept a request body generally require it.

Returns:boolean

whether or not this requestBody is required