In general, such a trap ... there is a line that comes from a well-known site. the problem is that in different categories it has many different levels of attachments, which it is impossible to catch with simple for and if. In this connection, I ask for help to push on the right path to get an ArrayList (map) with the data of the type name = aaa id = 111 parent = xx, etc. at the output.
{ "id": "204", "title": "Π’ΠΈΠΏ ΠΎΠ±ΡΡΠ²Π»Π΅Π½ΠΈΡ", "type": "select", "values": [ { "id": "1074", "title": "ΠΡΠΎΠ΄Π°ΠΌ", "params": [ { "id": "532", "title": "ΠΠΈΠ΄ ΠΎΠ±ΡΠ΅ΠΊΡΠ°", "type": "select", "values": [ { "id": "5494", "title": "ΠΠ°ΡΠ°ΠΆ", "params": [ { "id": "783", "title": "Π’ΠΈΠΏ Π³Π°ΡΠ°ΠΆΠ°", "multiple": true, "type": "select", "values": [ { "id": "10991", "title": "ΠΠ΅Π»Π΅Π·ΠΎΠ±Π΅ΡΠΎΠ½Π½ΡΠΉ" }, { "id": "10993", "title": "ΠΠΈΡΠΏΠΈΡΠ½ΡΠΉ" }, { "id": "10995", "title": "ΠΠ΅ΡΠ°Π»Π»ΠΈΡΠ΅ΡΠΊΠΈΠΉ" } ] } ] }, { "id": "5495", "title": "ΠΠ°ΡΠΈΠ½ΠΎΠΌΠ΅ΡΡΠΎ", "params": [ { "id": "781", "title": "Π’ΠΈΠΏ ΠΌΠ°ΡΠΈΠ½ΠΎΠΌΠ΅ΡΡΠ°", "multiple": true, "type": "select", "values": [ { "id": "10983", "title": "ΠΠ½ΠΎΠ³ΠΎΡΡΠΎΠ²Π½Π΅Π²ΡΠΉ ΠΏΠ°ΡΠΊΠΈΠ½Π³" }, { "id": "10985", "title": "ΠΠΎΠ΄Π·Π΅ΠΌΠ½ΡΠΉ ΠΏΠ°ΡΠΊΠΈΠ½Π³" }, { "id": "10987", "title": "ΠΡΡΡΠ°Ρ ΡΡΠΎΡΠ½ΠΊΠ°" }, { "id": "10989", "title": "ΠΡΠΊΡΡΡΠ°Ρ ΡΡΠΎΡΠ½ΠΊΠ°" } ] } ] } ] }, { "id": "785", "title": "ΠΡ
ΡΠ°Π½Π°", "type": "select", "values": [ { "id": "10997", "title": "ΠΠ°" }, { "id": "10999", "title": "ΠΠ΅Ρ" } ] } ] }, { "id": "1075", "title": "Π‘Π΄Π°ΠΌ", "params": [ { "id": "563", "title": "ΠΠΈΠ΄ ΠΎΠ±ΡΠ΅ΠΊΡΠ°", "type": "select", "values": [ { "id": "5819", "title": "ΠΠ°ΡΠ°ΠΆ", "params": [ { "id": "784", "title": "Π’ΠΈΠΏ Π³Π°ΡΠ°ΠΆΠ°", "multiple": true, "type": "select", "values": [ { "id": "10992", "title": "ΠΠ΅Π»Π΅Π·ΠΎΠ±Π΅ΡΠΎΠ½Π½ΡΠΉ" }, { "id": "10994", "title": "ΠΠΈΡΠΏΠΈΡΠ½ΡΠΉ" }, { "id": "10996", "title": "ΠΠ΅ΡΠ°Π»Π»ΠΈΡΠ΅ΡΠΊΠΈΠΉ" } ] } ] }, { "id": "5820", "title": "ΠΠ°ΡΠΈΠ½ΠΎΠΌΠ΅ΡΡΠΎ", "params": [ { "id": "782", "title": "Π’ΠΈΠΏ ΠΌΠ°ΡΠΈΠ½ΠΎΠΌΠ΅ΡΡΠ°", "multiple": true, "type": "select", "values": [ { "id": "10984", "title": "ΠΠ½ΠΎΠ³ΠΎΡΡΠΎΠ²Π½Π΅Π²ΡΠΉ ΠΏΠ°ΡΠΊΠΈΠ½Π³" }, { "id": "10986", "title": "ΠΠΎΠ΄Π·Π΅ΠΌΠ½ΡΠΉ ΠΏΠ°ΡΠΊΠΈΠ½Π³" }, { "id": "10988", "title": "ΠΡΡΡΠ°Ρ ΡΡΠΎΡΠ½ΠΊΠ°" }, { "id": "10990", "title": "ΠΡΠΊΡΡΡΠ°Ρ ΡΡΠΎΡΠ½ΠΊΠ°" } ] } ] } ] }, { "id": "786", "title": "ΠΡ
ΡΠ°Π½Π°", "type": "select", "values": [ { "id": "10998", "title": "ΠΠ°" }, { "id": "11000", "title": "ΠΠ΅Ρ" } ] } ] }, { "id": "1073", "title": "ΠΡΠΏΠ»Ρ", "params": [ { "id": "756", "title": "ΠΠΈΠ΄ ΠΎΠ±ΡΠ΅ΠΊΡΠ°", "type": "select", "values": [ { "id": "10897", "title": "ΠΠ°ΡΠ°ΠΆ" }, { "id": "10898", "title": "ΠΠ°ΡΠΈΠ½ΠΎΠΌΠ΅ΡΡΠΎ" } ] } ] }, { "id": "1076", "title": "Π‘Π½ΠΈΠΌΡ", "params": [ { "id": "779", "title": "ΠΠΈΠ΄ ΠΎΠ±ΡΠ΅ΠΊΡΠ°", "type": "select", "values": [ { "id": "10981", "title": "ΠΠ°ΡΠ°ΠΆ" }, { "id": "10982", "title": "ΠΠ°ΡΠΈΠ½ΠΎΠΌΠ΅ΡΡΠΎ" } ] } ] } ] }