https://github.com/cvent/jackson-compatibility-test
https://github.com/cvent/jackson-compatibility-test
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/cvent/jackson-compatibility-test
- Owner: cvent
- Created: 2019-04-05T20:22:11.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2025-06-08T04:27:58.000Z (about 1 year ago)
- Last Synced: 2025-06-08T05:40:50.280Z (about 1 year ago)
- Language: Java
- Size: 9.77 KB
- Stars: 0
- Watchers: 4
- Forks: 1
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# Enum Deserializer
This library smooths out differences in the way that different versions of jackson deserialize enums
to ease the process of upgrading between versions. In jackson-databind-2.3.3, an int can be successfully
deserialized into an enum while in jackson-databind-2.5.4 and newer, it can't. The custom deserializer
handles the following cases:
- Deserializing from int
- If there is a @JsonCreator method that takes in int, use that
- If there isn't and there is a single field in the enum of type int, match based on that
- Deserializing from string
- If the string parses to an int, parse it and use the int creation method instead
- If there isn't and there is a @JsonCreator method that takes in string, use that
- If there isn't match based on the name of the enum variants
# How to build locally
```
mvn clean install
```