Hello
I'm trying to create a JSON object like this
[
null,
{
"name": "nameExample",
"age": 45
},
{
"name": "anotherName",
"age": 55
}
]
And eventually get that JSON object as a string.
How can do so ?!
I am making some playground docs in #613 .
And I write below the part of source that I used to make JSON.
In swift, you need to write to make JSON object directly as Dictionary type using [ ] instead of { }.
var jsonArray: JSON = [
"array": [12.34, 56.78],
"users": [
[
"id": 987654,
"info": [
"name": "jack",
"email": "[email protected]"
],
"feeds": [98833, 23443, 213239, 23232]
],
[
"id": 654321,
"info": [
"name": "jeffgukang",
"email": "[email protected]"
],
"feeds": [12345, 56789, 12423, 12412]
]
]
]
There hasn't much activity on this issue for a while so I'll go ahead and consider it fixed. Let me know if you'd like me to reopen it. Thanks!
Most helpful comment
I am making some playground docs in #613 .
And I write below the part of source that I used to make JSON.
In swift, you need to write to make JSON object directly as
Dictionary typeusing[ ]instead of{ }.