-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Labels
2.18Issues planned at 2.18 or laterIssues planned at 2.18 or laterhas-failing-testIndicates that there exists a test case (under `failing/`) to reproduce the issueIndicates that there exists a test case (under `failing/`) to reproduce the issue
Milestone
Description
Search before asking
- I searched in the issues and found nothing similar.
Describe the bug
When using EnumFeature.WRITE_ENUMS_TO_LOWERCASE
, the @JsonProperty
values of enum fields are ignored.
Version Information
2.18.1
Reproduction
class ObjectMapperTest {
public enum Sauce {
@JsonProperty("Ketchup")
KETCHUP,
}
ObjectMapper objectMapper = new ObjectMapper()
.configure(EnumFeature.WRITE_ENUMS_TO_LOWERCASE, true);
@Test
void shouldUseJsonProperty() throws JsonProcessingException {
assertEquals("\"Ketchup\"", objectMapper.writeValueAsString(Sauce.KETCHUP));
}
}
Results in:
org.opentest4j.AssertionFailedError:
Expected :"Ketchup"
Actual :"ketchup"
Expected behavior
Should return @JsonProperty
defined value.
Additional context
No response
Metadata
Metadata
Assignees
Labels
2.18Issues planned at 2.18 or laterIssues planned at 2.18 or laterhas-failing-testIndicates that there exists a test case (under `failing/`) to reproduce the issueIndicates that there exists a test case (under `failing/`) to reproduce the issue