jackson-databind icon indicating copy to clipboard operation
jackson-databind copied to clipboard

JsonIdentityInfo for Map (not pojo)

Open zengkid opened this issue 6 months ago • 5 comments

Search before asking

  • [x] I searched in the issues and found nothing similar.

Describe the bug

I know that @JsonIdentityInfo can resolve the recyle reference for pojo, but how about the Map object?

Version Information

No response

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 -->
// sample for map
Map category = new HashMap();
category.put("id", 1);
category.put("name", "category1");

Map product = new HashMap();
product.put("id", 1);
product.put("name", "product1");
product.put("price", "100");
product.put("category", category);

List<Map> products = new ArrayList<>();
products.add(product);
category.put("products", products);

//


Expected behavior

No response

Additional context

No response

zengkid avatar Apr 26 '25 04:04 zengkid