Please tell me how you can parse the structure obtained with Firebase if there are parameters that use the link:

For example:

“SETTINGS_SETS” : { “-L0zrlGjhWpCZQHSW61_” : [ { “PARAMETERS” : [ { “uid” : “PARAMETERS/-L0zrlGjhWpCZQHSW61Z” }, { “uid” : “PARAMETERS/-L0zrlGjhWpCZQHSW61Z” }, { “uid” : “PARAMETERS/-L0zrlGo6tXoTUsVaoVO” } ] }, { “PARAMETERS” : [ { “uid” : “PARAMETERS/-L0zrlGo6tXoTUsVaoVO” } ] } ], “-L0zrlGku5bO9BBDR2cM” : [ { “PARAMETERS” : [ { “uid” : “PARAMETERS/-L0zrlGjhWpCZQHSW61W” }, { “uid” : “PARAMETERS/-L0zrlGjhWpCZQHSW61Y” }, { “uid” : “PARAMETERS/-L0zr7lNbBusPwSG2mMc” }, { “uid” : “PARAMETERS/-L0zrlGhVDjQ5nkq01Ll” } ] }, { “PARAMETERS” : [ { “uid” : “PARAMETERS/-L0zrlGhVDjQ5nkq01Lk” } ] }, { “PARAMETERS” : [ { “uid” : “PARAMETERS/-L0zrlGirpuKDjNEZ6T0" } ] }, { “PARAMETERS” : [ { “uid” : “PARAMETERS/-L0zrlGirpuKDjNEZ6Sy” }, { “uid” : “PARAMETERS/-L0zrlGirpuKDjNEZ6Sx” } ] } ] } 

I created a structure:

 struct Section: Codable { let name: String? let parameters: [String]? enum codingKeys: String, CodingKey { case parameters } } 

and Parameter Structure:

 struct Parameter: Codable { let name: String? } 

In theory, it should be correctly specified in the Section structure of an array of parameters:

 struct Section: Codable { let name: String? let parameters: [Parameter]? enum codingKeys: String, CodingKey { case parameters } } 

But due to the fact that there is a link the content does not work.

Please tell me how to deal with these situations ???

  • Show a part of the original JSON, what you brought as an example is not clear what it is. - Vitaly
  • Changed in the description - PrLion

0