我需要在Swift 3中创建以下JSON,并且不想使用外部库。我尝试了这个答案,但是我在数组内使用了自定义类(store和product),所以它无法正常工作。
"order":
[{
"store": 1,
"product": [
{
"id": 1,
"quantity": 1
},
{
"id": 2,
"quantity": 5
}]
},
{
"store": 4,
"product": [ {
"id": 1,
"quantity": 1
},
{
"id": 3,
"quantity": 1
}]
}]
}