Too many nest in JSON ... need to switch to XML?

I get a JSON exception complaining about a very deep nesting (over 30). I know that the value is hardcoded in JSONWriter. what can i do better? use another library without this restriction if such a thing exists? switch to xml?

UPDATE: I am serializing the designated tree structure in JSON. So, starting with root, each node breaks its children, which, in turn, insert them ...

{"type":"n1","links":[{"label":"l1","target":{"type":"n2","links":[{"label":"l2","target":{  ...}}]}}]}

I may have to rethink how I serialize my object structure.

UPDATE : I am using org.json

+4
source share
2

, JSON . (. ? , ) - 30 - , . , , , 30 . lib; , .

+6

, . ? , , .

+3

All Articles