Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/linq/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
YAML中的索引数组是什么?_Yaml - Fatal编程技术网

YAML中的索引数组是什么?

YAML中的索引数组是什么?,yaml,Yaml,在我的yaml spring启动应用程序配置中 additional-properties[auto.register.schemas]: false additional-properties[use.latest.version]: true 而且它有效!我在YAML规范中没有找到这种语法。这是什么意思?如何使用标准YAML重新编写?这和我的一样吗 additional-properties: - auto.register.schemas: false - use.lat

在我的yaml spring启动应用程序配置中

additional-properties[auto.register.schemas]: false
additional-properties[use.latest.version]: true
而且它有效!我在YAML规范中没有找到这种语法。这是什么意思?如何使用标准YAML重新编写?这和我的一样吗

additional-properties:
    - auto.register.schemas: false
    - use.latest.version: true

AFAIK: 每个元素(由一个点分隔)必须在自己的线上并相应地标记

foo:
   bar:
       name: value
       name2: value2
   fez: value
你的例子是:

additional-properties:
    auto:
       register:
           schemas: false

经过实验和发现后,我得出结论(至少在Spring
application.yaml
):

相当于

camel.component.kafka.additional-properties:
            "[auto.register.schemas]": false
            "[use.latest.version]": true
camel:
   component:
      kafka:
         additional-properties:
            "[auto.register.schemas]": false
            "[use.latest.version]": true
这相当于

camel.component.kafka.additional-properties:
            "[auto.register.schemas]": false
            "[use.latest.version]": true
camel:
   component:
      kafka:
         additional-properties:
            "[auto.register.schemas]": false
            "[use.latest.version]": true

根据文件,这可能是一个错误。这肯定是YAML所不知道的。你能给出“它是如何工作的”的详细信息吗?这是不正确的,至少对Spring
application.yaml不正确。第二部分也不正确,请参见我的答案。