)]}'
{
  "commit": "d4fd0041cff8dcff93631b861e20c8db87acbd7c",
  "tree": "a0a1e105209eb6827e0788e4cdf956f9c3009158",
  "parents": [
    "7eea0c4ea4efe08541382ff6be12bce7a39f1419"
  ],
  "author": {
    "name": "Niels Lohmann",
    "email": "mail@nlohmann.me",
    "time": "Sat Sep 05 16:48:07 2026 +0200"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Fri Sep 11 17:56:30 2026 +0200"
  },
  "message": "Restore a duplicate key\u0027s prior value when the callback rejects its new value\n\njson_sax_dom_callback_parser::key() unconditionally overwrote the object\nslot for a key with a `discarded` placeholder as soon as the key was\naccepted by the parser callback. For a duplicate key (legal JSON), this\ndestroyed the pre-existing value from an earlier occurrence of the same\nkey before the new value was even parsed. If the new value was then\nrejected by the callback, remove_discarded_value() erased the member\nentirely instead of leaving the original value in place, contradicting\nthe documented behavior that a discarded value behaves as if it was\nnever read.\n\nAdd a small stash of (slot pointer, previous value) pairs so that when\nkey() overwrites an existing member with the discarded placeholder, the\nprevious value can be restored later if the corresponding value (scalar,\nobject, or array) is rejected, instead of being erased. The stash entry\nis dropped without restoring once the new value is definitively\naccepted (in handle_value() for scalars, end_object()/end_array() for\ncontainers), so a duplicate key whose new value is accepted still keeps\nthe last value as before. Non-duplicate keys are unaffected: rejecting\ntheir value still removes the member entirely, since there is nothing\nto restore.\n\nSigned-off-by: Niels Lohmann \u003cmail@nlohmann.me\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "1627d232637a238b84cc4c05310f06cc3ea1e483",
      "old_mode": 33188,
      "old_path": "include/nlohmann/detail/input/json_sax.hpp",
      "new_id": "ef9c8a697daef9a3b352cae475cc9fcadf73f05e",
      "new_mode": 33188,
      "new_path": "include/nlohmann/detail/input/json_sax.hpp"
    },
    {
      "type": "modify",
      "old_id": "8c7ffb2226c6e549ed3399cd5f7c97cb8fae182a",
      "old_mode": 33188,
      "old_path": "single_include/nlohmann/json.hpp",
      "new_id": "380b240a92d21022b6e59e331b894a0c200c64fc",
      "new_mode": 33188,
      "new_path": "single_include/nlohmann/json.hpp"
    },
    {
      "type": "modify",
      "old_id": "cb2ed59a69f0e852a12e70d626b22e0066e0fa8d",
      "old_mode": 33188,
      "old_path": "tests/src/unit-regression3.cpp",
      "new_id": "359f8c1082ff65209e70d88092793bc09f4952f5",
      "new_mode": 33188,
      "new_path": "tests/src/unit-regression3.cpp"
    }
  ]
}
