我正在撰寫一個 Json api,輸入是這樣的。如何在 json 中正確輸入?輸入是 Strapi API 中的 Json
Category 1:
{
Name : x
Price: y
Url: z
}
{
Name : a
Price: b
Url: c
}
{
Name : d
Price: e
Url: f
}
Category 2:
Another array
映射中仍然存在問題:
still have the issue Warning: Encountered two children with the same key, `1`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version.
uj5u.com熱心網友回復:
以下結構適用于您的用例:
{
"categories": {
"Category 1": [
{
"Name": "x",
"Price": "y",
"Url": "z"
},
{
"Name": "a",
"Price": "b",
"Url": "c"
},
{
"Name": "d",
"Price": "e",
"Url": "f"
}
],
"Category 2": [
{
"Name": "x",
"Price": "y",
"Url": "z"
},
{
"Name": "a",
"Price": "b",
"Url": "c"
},
{
"Name": "d",
"Price": "e",
"Url": "f"
}
]
}
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/439300.html
