Menu

#14 Error deserializing json with : in keys

1.9.2
closed-invalid
5
2010-10-16
2010-03-20
Anonymous
No

There is a problem with use flexjson to deserialize json strings like that:

http://open-services.net/bin/view/Main/CmJsonFormatV1?sortcol=table;up=#Collections

I tried to deserialize it in parts using this code attached.

But flexjson replace the caracter ':' of KEYS to '=' and it make erros in second deserialize.

Discussion

  • Nobody/Anonymous

     
  • Bruno Braga

    Bruno Braga - 2010-03-20

    I posted this item as a nobody by mistake. Charlie, I'll monitor this item if you have questions.

     
  • Charlie Hubbard

    Charlie Hubbard - 2010-10-16
    • status: open --> closed-invalid
     
  • Charlie Hubbard

    Charlie Hubbard - 2010-10-16

    I did debug the parser and found it wasn't manipulating the keys in anyway in 2.0, and the keys and data were correct.

    I did successfully deserialize this object into a Map using the following code:

    Map<String,Object> page2 = new JSONDeserializer<Map<String,Object>>() .deserialize( json );
    List results = page2.get("oslc_cm:results");
    assertEquals( "http://localhost:9080/results/3", page2.get("oslc_cm:next") );

    You don't have to deserialize this again to get the List object contained within. So I think this is operator error.

     

Log in to post a comment.