- All Implemented Interfaces:
Serializable,Comparable<OpenAPIMediaType>,Constable
Abstraction of the different representations of a static OpenAPI document
file and the file type(s) they correspond to.
Each OpenAPIMediaType stands for a single format (e.g., yaml,
json). That said, each can map to multiple file types (e.g., yml and
yaml) and multiple actual media types (the proposed OpenAPI media type
vnd.oai.openapi and various other YAML types proposed or in use).
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic Optional<OpenAPIMediaType>byFileType(String fileType) Find media type by file suffix.static Optional<OpenAPIMediaType>byMediaType(io.helidon.common.media.type.MediaType mt) Find OpenAPI media type by media type.io.smallrye.openapi.runtime.io.Formatformat()Format associated with this media type.File types matching this media type.static io.helidon.common.media.type.MediaType[]Media types we recognize as OpenAPI, in order of preference.List of all supported file types.static OpenAPIMediaTypeReturns the enum constant of this class with the specified name.static OpenAPIMediaType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
JSON
JSON media type. -
YAML
YAML media type.
-
-
Field Details
-
DEFAULT_TYPE
Default media type (YAML).
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
format
public io.smallrye.openapi.runtime.io.Format format()Format associated with this media type.- Returns:
- format
-
matchingTypes
File types matching this media type.- Returns:
- file types
-
byFileType
Find media type by file suffix.- Parameters:
fileType- file suffix- Returns:
- media type or empty if not supported
-
byMediaType
Find OpenAPI media type by media type.- Parameters:
mt- media type- Returns:
- OpenAPI media type or empty if not supported
-
recognizedFileTypes
List of all supported file types.- Returns:
- file types
-
preferredOrdering
public static io.helidon.common.media.type.MediaType[] preferredOrdering()Media types we recognize as OpenAPI, in order of preference.- Returns:
- MediaTypes in order that we recognize them as OpenAPI content.
-