Linked Questions

Popular Questions

I have a JSON string generated using Json.Net C# library with this settings:

JsonConvert.DefaultSettings = () => new JsonSerializerSettings
            {
                Formatting = Newtonsoft.Json.Formatting.Indented,
                ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore,
                PreserveReferencesHandling = PreserveReferencesHandling.All
            };

Note the PreserveReferencesHandling to have references generated in json instead of the same object being copied (duplicated) on each object reference.

How can I deserialize the result in java ? Google Gson library fails to parse.

UPDATE: The error can't help much in my opinion: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 154944 path $.Tables[0].Columns[4].ForeignKeyTable.ForeignKeyChildren1.Columns[0].ForeignKeyTable.Indexes

I'll put a small fragment of the json data, note the $id, $ref: JSON with references format

Related Questions