Dear Ivy team, I face an issue when using Map<String, Object>. I have two key, there has the same value, then it serializes like it:

{
  "additionalData": {
    "@class": "Class&lt;java.util.HashMap&gt;",
    "firstKey": {
      "@class": "Class&lt;objecttype.Assignee&gt;",
      "@id": "$Ref-1",
      "displayName": "Hen"
    },
    "secondKey": "$Ref-1"
  }
}

And when deserializes I expect it should be:
{firstKey=Assignee [displayName=Hen], secondKey=Assignee [displayName=Hen]}

But it actual:
{firstKey=Assignee [displayName=Hen], secondKey=$Ref-1}
The second key now map with wrong value.

Is there any way to overcome this issue? Thanks a lot!

asked 05.12.2019 at 22:19

Hen%20Tran's gravatar image

Hen Tran
(suspended)
accept rate: 0%

edited 09.12.2019 at 03:08

Reguel%20Wermelinger's gravatar image

Reguel Werme... ♦♦
9.4k31958

Thanks for the reply, I try this way. We need the <string, object=""> for our business and then convert it to string and stored it to compare later, It works for me now. I'm using ivy 7.0.10, FYI, Thank you ;)

(08.12.2019 at 22:47) Hen Tran Hen%20Tran's gravatar image

Hm... It seems that this is a bug in our deserialization code. Is working if you serialize a Map<string, assignee=""> but not with abstract classes. I will create an issue for this. A roundtrip to "solve" it for now could be to create 2 objects and don't save the same object.

link

answered 06.12.2019 at 05:14

Lukas%20Lieb's gravatar image

Lukas Lieb ♦♦
4412412
accept rate: 61%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×17
×2

Asked: 05.12.2019 at 22:19

Seen: 1,129 times

Last updated: 09.12.2019 at 06:50