JsonSerializerSwift icon indicating copy to clipboard operation
JsonSerializerSwift copied to clipboard

Multi-dimentional Arrays

Open ShalakoSnell opened this issue 8 years ago • 3 comments

Hi @peheje,

I added this to my local to handle Multi-dimentional Arrays.

else if let array = value as? [[Any]] {
                handledValue += "["
                for (index, value) in array.enumerated() {
                    handledValue += "\(value)"
                    handledValue += (index < array.count-1 ? ", " : "")
                }
                handledValue += "]"
            }

ShalakoSnell avatar Oct 24 '16 05:10 ShalakoSnell

Cool! Maybe we could create a unit test for this and pull it into master?

peheje avatar Oct 28 '16 11:10 peheje

hi

i am trying this but i am getting extra {} in jsonString

{[{"WebAddress": "http://yahoo.com", "State": "1"}]}

it should generate

[{"WebAddress": "Asdadsad", "State": "1"}]

iehsan77 avatar Apr 12 '17 09:04 iehsan77

I think recent commit 5ae566790a4066d1392dc2d7fc24d9ae70c040d8 might have fixed that. If you post the test I can try to fit it in there. Would appreciate it!

peheje avatar Jun 14 '17 12:06 peheje