Class SerdeYamlConfiguration.ReadFeatures
java.lang.Object
io.micronaut.serde.yaml.SerdeYamlConfiguration.ReadFeatures
- Enclosing class:
SerdeYamlConfiguration
@ConfigurationProperties("read-features")
public static final class SerdeYamlConfiguration.ReadFeatures
extends Object
Controls YAML deserialization behavior.
- Since:
- 3.2.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe default maximum number of code points a single YAML input may contain: 3 MiB. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturns the maximum number of code points a single YAML input may contain.booleanReturns whether YAML boolean-like words such asyes,no,on, andoffshould be parsed as strings.booleanReturns whether an empty plain YAML scalar should be parsed asnull.voidsetBooleanAsStrings(boolean booleanAsStrings) Sets whether YAML boolean-like words should be parsed as strings.voidsetCodePointLimit(int codePointLimit) Sets the maximum number of code points a single YAML input may contain.voidsetEmptyStringAsNull(boolean emptyStringAsNull) Sets whether an empty plain YAML scalar should be parsed asnull.
-
Field Details
-
DEFAULT_CODE_POINT_LIMIT
public static final int DEFAULT_CODE_POINT_LIMITThe default maximum number of code points a single YAML input may contain: 3 MiB.- See Also:
-
-
Constructor Details
-
ReadFeatures
public ReadFeatures()
-
-
Method Details
-
isBooleanAsStrings
public boolean isBooleanAsStrings()Returns whether YAML boolean-like words such asyes,no,on, andoffshould be parsed as strings. The canonicaltrueandfalsevalues are still parsed as booleans. This feature is enabled by default to match Jackson 3 behavior.- Returns:
- Whether boolean-like words should be parsed as strings
-
setBooleanAsStrings
public void setBooleanAsStrings(boolean booleanAsStrings) Sets whether YAML boolean-like words should be parsed as strings.- Parameters:
booleanAsStrings- Whether boolean-like words should be parsed as strings
-
isEmptyStringAsNull
public boolean isEmptyStringAsNull()Returns whether an empty plain YAML scalar should be parsed asnull. This feature is enabled by default.- Returns:
- Whether an empty plain scalar should be parsed as
null
-
setEmptyStringAsNull
public void setEmptyStringAsNull(boolean emptyStringAsNull) Sets whether an empty plain YAML scalar should be parsed asnull.- Parameters:
emptyStringAsNull- Whether an empty plain scalar should be parsed asnull
-
getCodePointLimit
public int getCodePointLimit()Returns the maximum number of code points a single YAML input may contain. Larger input is rejected before it is parsed, which bounds the memory an untrusted document can claim. Default value (3145728).- Returns:
- The code point limit
-
setCodePointLimit
public void setCodePointLimit(int codePointLimit) Sets the maximum number of code points a single YAML input may contain.- Parameters:
codePointLimit- The code point limit, greater than zero
-