Menu

#13 Map key should be JSONified, just like the map value

closed
nobody
None
5
2012-02-02
2009-09-02
No

We have a Map<Object,Object> where both key and value are application specific beans. When this map is serialized, key is put into JSON string by simply calling its toString() method, against what looks more natural. Introducing this behaviour would not cause problem to existing behaviour as existing users would be using standard Java classes as key.

Discussion

  • Charlie Hubbard

    Charlie Hubbard - 2012-02-02

    This is technically NOT valid JSON. Unfortuantely, the key on a JSON object MUST be a string. This will have to be rejected because it wouldn't conform to the spec.

     
  • Charlie Hubbard

    Charlie Hubbard - 2012-02-02
    • status: open --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB