Annotation Type Content
-
@Target(ANNOTATION_TYPE) @Retention(RUNTIME) @Inherited public @interface Content
The annotation may be used to define the content/media type of a parameter, request or response, by defining it as fieldParameter.content()
,RequestBody.content()
orApiResponse.content()
.If
schema()
is defined, swagger-jaxrs2 reader engine will consider it along with JAX-RS annotations, element type and context as input to resolve the annotated element into an OpenAPI schema definition for such element.- See Also:
- Example (OpenAPI specification),
Schema
,Parameter
,ApiResponse
,RequestBody
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description Schema
additionalPropertiesSchema
The schema properties defined for schema provided in @SchemaArraySchema
array
The schema of the array that defines the type used for the content.Encoding[]
encoding
An array of encodings The key, being the property name, MUST exist in the schema as a property.ExampleObject[]
examples
An array of examples used to show the use of the associated schema.Extension[]
extensions
The list of optional extensionsString
mediaType
The media type that this object applies to.Schema
schema
The schema defining the type used for the content.SchemaProperty[]
schemaProperties
The schema properties defined for schema provided in @Schema
-
-
-
Element Detail
-
mediaType
String mediaType
The media type that this object applies to.- Returns:
- the media type value
- Default:
- ""
-
-
-
examples
ExampleObject[] examples
An array of examples used to show the use of the associated schema.- Returns:
- the list of examples
- Default:
- {}
-
-
-
schema
Schema schema
The schema defining the type used for the content.- Returns:
- the schema of this media type
- Default:
- @io.swagger.v3.oas.annotations.media.Schema
-
-
-
schemaProperties
SchemaProperty[] schemaProperties
The schema properties defined for schema provided in @Schema- Returns:
- the schema properties
- Since:
- 2.2.0
- Default:
- {}
-
-
-
additionalPropertiesSchema
Schema additionalPropertiesSchema
The schema properties defined for schema provided in @Schema- Returns:
- the schema properties
- Since:
- 2.2.0
- Default:
- @io.swagger.v3.oas.annotations.media.Schema
-
-
-
array
ArraySchema array
The schema of the array that defines the type used for the content.- Returns:
- the schema of the array
- Default:
- @io.swagger.v3.oas.annotations.media.ArraySchema
-
-
-
encoding
Encoding[] encoding
An array of encodings The key, being the property name, MUST exist in the schema as a property.- Returns:
- the array of encodings
- Default:
- {}
-
-
-
extensions
Extension[] extensions
The list of optional extensions- Returns:
- an optional array of extensions
- Default:
- {}
-
-