jackson-databind: Long field value breaks parsing

Search before asking

  • I searched in the issues and found nothing similar.

Describe the bug

I have the following structure to deserialize { "event_type": "switch_state", "event": { "model": { "units": [], "ports": [], "limits": { "atx": { "click_delays": { "power": { "default": 0.5, "min": 0, "max": 10 }, "power_long": { "default": 5.5, "min": 0, "max": 10 }, "reset": { "default": 0.5, "min": 0, "max": 10 } } } } }, "summary": { "active_port": -1, "synced": true }, "edids": { "all": { "default": { "name": "Default", "data": "00FFFFFFFFFFFF0031D8737701010101231A010380351E780E0565A756529C270F50543FED00B300A9C0950090408180814081C0714F023A801871382D40582C45000F282100001E000000FF0043414645424142452020202020000000FD00324B0F5211000A202020202020000000FC0050694B564D20563420506C7573012D020320714B90041F13223E213D203C0167030C001000802D23097F0783010000023A801871382D40582C45000F282100001E011D007251D01E206E2855000F282100001E023A80D072382D40102C45800F282100001E283C80A070B023403020360006442100001A000000000000000000000000000000000000000000000030", "parsed": { "mfc_id": "LNX", "product_id": 30579, "serial": 16843009, "monitor_name": "PiKVM V4 Plus", "monitor_serial": "CAFEBABE", "audio": true } } }, "used": [] }, "colors": { "beacon": { "blink_ms": 250, "brightness": 255, "red": 228, "blue": 156, "green": 44 }, "flashing": { "blink_ms": 0, "brightness": 128, "red": 0, "blue": 255, "green": 170 }, "bootloader": { "blink_ms": 0, "brightness": 128, "red": 255, "blue": 0, "green": 170 }, "inactive": { "blink_ms": 0, "brightness": 64, "red": 255, "blue": 0, "green": 0 }, "active": { "blink_ms": 0, "brightness": 128, "red": 0, "blue": 0, "green": 255 } }, "video": { "links": [] }, "usb": { "links": [] }, "beacons": { "uplinks": [], "downlinks": [], "ports": [] }, "atx": { "busy": [], "leds": { "power": [], "hdd": [] } } } }

The “mfc_id” field was incorrectly assigned to the “default” object and not to the “parsed” object.

All fields from object “parsed” incorrectly considered as fields from object “default”.

Thank you very much for the great de/serialization tool. It’s the best in the world.

Version Information

2.17.2

Reproduction

<-- Any of the following

  1. Brief code sample/snippet: include here in preformatted/code section
  2. Longer example stored somewhere else (diff repo, snippet), add a link
  3. Textual explanation: include here –>
// Your code here

Expected behavior

No response

Additional context

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (7 by maintainers)

Most upvoted comments

Please try Jackson 2.18.3. This sounds like an issue that we fixed in 2.18.3.

FasterXML/jackson-core#1397

I think “Long” here refers to length of content and not Java Long (number) type. So probably not related to that issue.

If this was an issue affecting me in work, I would start by creating a Java instance and serializing it to see what the JSON looked like. That might help in finding differences in structure from the JSON you are trying to deserialize.

@KyryloSemenkoDiversium please refer to other issues and minimize the reproduction. U cant just dump hundreds of lines