【发布时间】:2022-01-07 00:37:17
【问题描述】:
我是使用 YAML 的新手。我想知道是否可以像我在下面的示例中尝试的那样“嵌套”YAML 锚点。不幸的是,我收到一个错误YAMLException: unidentified alias "foo" at line 13, column 19: category: *foo ^
namespace: &namespace-definition
name: "Hellow world"
value: "hw"
categories: &categories
- &foo:
name: "foo"
namespace: *namespace-definition
- &bar:
name: "bar"
namespace: *namespace-definition
keys:
- name: "element1"
category: *foo
- name: "element2"
category: *bar
还有其他方法可以实现我想要做的事情,还是不可能?
【问题讨论】:
标签: yaml