Building an array of dictionary items in YAML?
问题 Basically trying to something in yaml that could be done using this json: { models: [ { model: "a" type: "x" #bunch of properties... }, { model: "b" type: "y" #bunch of properties... } ] } So far this is what I have, it does not work because I am repeating my model key but what can be a proper way to do that by keeping that model key word? models: model: type: "x" #bunch of properties... model: type: "y" #bunch of properties... 回答1: Use a dash to start a new list element: models: - model: "a"