-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Milestone
Description
Currently, when Jackson deserializes a number in an untyped context (eg Object), Jackson returns either Integer or Long depending on the size. This requires endless littering of boilerplate casts and conversions throughout code, for example:
Map<String, Object> map = mapper.readValue(payload, Map.class);
//long value = (Long)map.get("key"); // throws class cast exception
long value = ((Number)map.get("key")).longValue; // gack
It would be fantastic if Jackson had an option to force all untyped numbers to Long instead of Integer. I propose DeserializationFeature.USE_LONG_FOR_INTS to be consistent with other features.
stevenschlansker, GUTTERTRASH, okylymnyk, xer0x, emeraldhieu and 3 more
Metadata
Metadata
Assignees
Labels
No labels