我正在尝试为对象列表生成yaml,并且我收到错误声明错误的语法
tables:
table_ab:
bankspecificparams:
-
issuer:"bank1"
cardname:""
expiredinterval:"90d"
fields:
- "a"
- "b"
-
issuer:"bank2"
cardname:""
expiredinterval:"40d"
fields:
- "a"
- "b"
-
issuer:"bank3"
cardname:"name1"
expiredinterval:"40d"
fields:
- "a"
- "b"
以下yaml snytax似乎不正确。我不确定这里有什么问题。
答案 0 :(得分:0)
tables:
table_ab:
bankspecificparams:
-
cardname: ""
expiredinterval: 90d
fields:
- a
- b
issuer: bank1
-
cardname: ""
expiredinterval: 40d
fields:
- a
- b
issuer: bank2
-
cardname: name1
expiredinterval: 40d
fields:
- a
- b
issuer: bank3
添加空格解决了问题