0
如何在YAML中定義map[string]
對象?如何在yaml中定義map [string]對象?
我
{
"name": "SampleStore",
"books": {
"sample1": {
"author": "test1",
"prize": "1221"
},
"sample2": {
"author": "test2",
"prize": "890"
}
}
}
我在YAML定義的對象爲JSON對象:
Types:
store:
name:
type: String
books:
Items:
Referemce: book_details
book_details:
author:
type: String
prize:
type: String
但是,這是列表語法,我希望本書的地圖。如何在YAML中定義這些類型的地圖?
你的YAML中沒有順序(列表)。請說明你認爲是一個序列。 – Anthon