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_elseProvides the else sub schema related to this schemaSchema_ifProvides the if sub schema related to this schemaSchema_thenProvides the then sub schema related to this schemaArraySchemaadditionalPropertiesArraySchemaThe additionalProperties array schema defined for schema provided in @Schema If the additionalProperties schema is not an array, use additionalPropertiesSchemaSchemaadditionalPropertiesSchemaThe additionalProperties schema defined for schema provided in @Schema If the additionalProperties schema is an array, use additionalPropertiesArraySchemaSchema[]allOfProvides the allOf sub schemas related to this schema..Schema[]anyOfProvides the anyOf sub schemas related to this schema.ArraySchemaarrayThe schema of the array that defines the type used for the content.SchemacontentSchemaProvides the content schema related to this schemaDependentSchema[]dependentSchemasSubschemas to be applied for a given condition.Encoding[]encodingAn array of encodings The key, being the property name, MUST exist in the schema as a property.ExampleObject[]examplesAn array of examples used to show the use of the associated schema.Extension[]extensionsThe list of optional extensionsStringmediaTypeThe media type that this object applies to.SchemanotSet schemas to validate according a given condition.Schema[]oneOfProvides the oneOf sub schemas related to this schema.SchemapropertyNamesProvides property names related to this schemaSchemaschemaThe schema defining the type used for the content.SchemaProperty[]schemaPropertiesThe 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 additionalProperties schema defined for schema provided in @Schema If the additionalProperties schema is an array, use additionalPropertiesArraySchema- Returns:
- the additionalProperties schema
- Since:
- 2.2.0
- Default:
- @io.swagger.v3.oas.annotations.media.Schema
-
-
-
additionalPropertiesArraySchema
ArraySchema additionalPropertiesArraySchema
The additionalProperties array schema defined for schema provided in @Schema If the additionalProperties schema is not an array, use additionalPropertiesSchema- Returns:
- the additionalProperties array schema
- Since:
- 2.2.16
- Default:
- @io.swagger.v3.oas.annotations.media.ArraySchema
-
-
-
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:
- {}
-
-
-
dependentSchemas
DependentSchema[] dependentSchemas
Subschemas to be applied for a given condition.- Returns:
- list of dependent schemas.
- Since:
- 2.2.12 / OpenAPI 3.1
- Default:
- {}
-
-
-
contentSchema
Schema contentSchema
Provides the content schema related to this schema- Returns:
- content schema
- Since:
- 2.2.12 / OpenAPI 3.1
- Default:
- @io.swagger.v3.oas.annotations.media.Schema
-
-
-
propertyNames
Schema propertyNames
Provides property names related to this schema- Returns:
- proeprty names
- Since:
- 2.2.12 / OpenAPI 3.1
- Default:
- @io.swagger.v3.oas.annotations.media.Schema
-
-
-
_if
Schema _if
Provides the if sub schema related to this schema- Returns:
- if schema
- Since:
- 2.2.12 / OpenAPI 3.1
- Default:
- @io.swagger.v3.oas.annotations.media.Schema
-
-
-
_then
Schema _then
Provides the then sub schema related to this schema- Returns:
- then schema
- Since:
- 2.2.12 / OpenAPI 3.1
- Default:
- @io.swagger.v3.oas.annotations.media.Schema
-
-
-
_else
Schema _else
Provides the else sub schema related to this schema- Returns:
- else schema
- Since:
- 2.2.12 / OpenAPI 3.1
- Default:
- @io.swagger.v3.oas.annotations.media.Schema
-
-
-
not
Schema not
Set schemas to validate according a given condition.- Returns:
- not schema to be validated
- Since:
- 2.2.12 / OpenAPI 3.1
- Default:
- @io.swagger.v3.oas.annotations.media.Schema
-
-
-
oneOf
Schema[] oneOf
Provides the oneOf sub schemas related to this schema.- Returns:
- oneOf sub schemas
- Since:
- 2.2.12 / OpenAPI 3.1
- Default:
- {}
-
-
-
anyOf
Schema[] anyOf
Provides the anyOf sub schemas related to this schema.- Returns:
- anyOf sub schemas
- Since:
- 2.2.12 / OpenAPI 3.1
- Default:
- {}
-
-
-
allOf
Schema[] allOf
Provides the allOf sub schemas related to this schema..- Returns:
- allOf sub schemas
- Since:
- 2.2.12 / OpenAPI 3.1
- Default:
- {}
-
-