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

public @Interface Encoding

extends Annotation
Annotations
@Target
@Retention:RUNTIME
@Inherited
Imports
java.lang.annotation.Inherited, .Retention, .RetentionPolicy, .Target, org.eclipse.microprofile.openapi.annotations.extensions.Extension, org.eclipse.microprofile.openapi.annotations.headers.Header

Single encoding definition to be applied to single Schema Object
See Also
OpenAPI Specification Encoding Object

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

whether or not this encoding instance allows reserved characters
allowReserved
()

Determines whether the encoding instance value SHOULD allow reserved characters, as defined by RFC3986 to be included without percent-encoding.

public String

Returns:

the contentType property of this encoding instance
contentType
()

The Content-Type for encoding a specific property.

public boolean

Returns:

whether or not this array type encoding will have separate parameters generated for each array value
explode
()

When explode is set to true, property values of type array or object generate separate parameters for each value of the array, or key-value-pair of the map.

public Extension[]

Returns:

array of extensions
extensions
()

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

public Header[]

Returns:

the array of headers for this encoding instance
headers
()

An array of headers that corresponds to a map of headers in the encoding model.

public String

Returns:

the name of this encoding instance
name
()

The name of this encoding object instance.

public String

Returns:

the style of this encoding instance
style
()

Style describes how the encoding value will be serialized depending on the type of the parameter value.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

allowReservedback to summary
public boolean allowReserved()

Determines whether the encoding instance value SHOULD allow reserved characters, as defined by RFC3986 to be included without percent-encoding.

See RFC3986 for full definition of reserved characters.

Returns:boolean

whether or not this encoding instance allows reserved characters

contentTypeback to summary
public String contentType()

The Content-Type for encoding a specific property. Default value depends on the property type.

For example, for binary string - contentType is application/octet-stream, for primitive types - text/plain, for object - application/json. The value can be a specific media type (e.g. application/json), a wildcard media type (e.g. image/*), or a comma-separated list of the two types.

Returns:String

the contentType property of this encoding instance

explodeback to summary
public boolean explode()

When explode is set to true, property values of type array or object generate separate parameters for each value of the array, or key-value-pair of the map.

For other types of properties this property has no effect. When style is form, the default value is true.

For all other styles, the default value is false.
Returns:boolean

whether or not this array type encoding will have separate parameters generated for each array value

extensionsback to summary
public Extension[] extensions()

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

Returns:Extension[]

array of extensions

Since
3.1
headersback to summary
public Header[] headers()

An array of headers that corresponds to a map of headers in the encoding model. Allows additional information to be provided as headers.

For example, Content-Disposition.

Content-Type is described separately and SHALL be ignored in this section. This property SHALL be ignored if the request body media type is not a multipart.
Returns:Header[]

the array of headers for this encoding instance

nameback to summary
public String name()

The name of this encoding object instance. This property is a key in an encoding map of a MediaType object and MUST exist in a schema as a property.

Returns:String

the name of this encoding instance

styleback to summary
public String style()

Style describes how the encoding value will be serialized depending on the type of the parameter value. This property SHALL be ignored if the request body media type is not application/x-www-form-urlencoded or multipart/form-data.

Default values include: form, spaceDelimited, pipeDelimited, and deepObject.

Returns:String

the style of this encoding instance