Backport issue for #1605 for the 4.32.0 release:
management.endpoint.health.show-details=when_authorized
is flagged as an error, even though the Spring Boot internally converts when_authorized correctly to Show.WHEN_AUTHORIZED.
It looks like the validation logic around enum values for properties is currently:
- lower-case name of the enum with
- instead of _ (when-authorized does not show an error)
- upper-case exact name of the enum (
WHEN_AUTHORIZED does not show an error)
But the conversion logic in Spring Boot is a little different. It is located in LenientObjectToEnumConverterFactory. It basically is:
- does the value match the exact enum value (in this case
WHEN_AUTHORIZED)
- if not, then strip all non-digit and non-letter characters, convert to lowercase, and find the enum value that way.
That results in:
when_authorized is mapped to WHEN_AUTHORIZED
when-authorized is mapped to WHEN_AUTHORIZED
WHEN-AUTHORIZED is mapped to WHEN_AUTHORIZED
This should be reflected in the validation logic for the property editors (.properties + .yml).
Backport issue for #1605 for the
4.32.0release:is flagged as an error, even though the Spring Boot internally converts
when_authorizedcorrectly toShow.WHEN_AUTHORIZED.It looks like the validation logic around enum values for properties is currently:
-instead of_(when-authorizeddoes not show an error)WHEN_AUTHORIZEDdoes not show an error)But the conversion logic in Spring Boot is a little different. It is located in
LenientObjectToEnumConverterFactory. It basically is:WHEN_AUTHORIZED)That results in:
when_authorizedis mapped toWHEN_AUTHORIZEDwhen-authorizedis mapped toWHEN_AUTHORIZEDWHEN-AUTHORIZEDis mapped toWHEN_AUTHORIZEDThis should be reflected in the validation logic for the property editors (
.properties+.yml).