Class YamlMediaTypes
java.lang.Object
io.micronaut.serde.yaml.YamlMediaTypes
Media type constants for YAML.
application/yaml is the media type registered by RFC 9512; application/x-yaml
is the older type that Micronaut exposes as MediaType.APPLICATION_YAML. The YAML
message body handler accepts both.
- Since:
- 3.2.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringLegacy YAML media type string (application/x-yaml).static final io.micronaut.http.MediaTypeLegacy YAMLMediaType(application/x-yaml).static final StringYAML media type string (application/yaml, RFC 9512).static final io.micronaut.http.MediaTypeYAMLMediaType(application/yaml). -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisYaml(@Nullable io.micronaut.http.MediaType mediaType) Whether the media type is one of the YAML media types, or a wildcard that covers them.
-
Field Details
-
APPLICATION_YAML
YAML media type string (application/yaml, RFC 9512).- See Also:
-
APPLICATION_YAML_TYPE
public static final io.micronaut.http.MediaType APPLICATION_YAML_TYPEYAMLMediaType(application/yaml). -
APPLICATION_X_YAML
Legacy YAML media type string (application/x-yaml).- See Also:
-
APPLICATION_X_YAML_TYPE
public static final io.micronaut.http.MediaType APPLICATION_X_YAML_TYPELegacy YAMLMediaType(application/x-yaml).
-
-
Method Details
-
isYaml
public static boolean isYaml(@Nullable io.micronaut.http.MediaType mediaType) Whether the media type is one of the YAML media types, or a wildcard that covers them.- Parameters:
mediaType- The media type- Returns:
trueif YAML can be read from or written to the media type
-