【问题标题】:How to declare array inside array in yaml file如何在yaml文件中声明数组内的数组
【发布时间】:2017-10-10 09:44:51
【问题描述】:

例如:率:

{floor: '1', functionId: BDEB1, 
baseRates: { baseRateAgreementLevel: baseRateAgreementLevel,name: LIBOR GBP 1 Month, value: 0.1}
} 

rate 上面是一个数组,baserate 是另一个数组,它在 rate 数组中

在蛇 yaml 文件中的数组内声明数组时出现错误“无法创建属性”。

【问题讨论】:

  • 缩进在这里是相关的,所以我不能为你编辑它。每行左边放 4 个空格,表示标记中的一行代码。

标签: snakeyaml


【解决方案1】:

我猜你打算写:

rate:
    floor: '1'
    functionId: BDEB1
    baseRates: 
        baseRateAgreementLevel: baseRateAgreementLevel
        name: LIBOR GBP 1 Month
        value: 0.1

这是你想要的吗?查看 here 以获取 json 等效表示。

【讨论】:

  • 您能否在答案中添加生成的 json 表示,因为该链接可能会在一段时间内失效
猜你喜欢
  • 2021-10-21
  • 2019-12-05
  • 2015-07-29
  • 1970-01-01
  • 2018-09-27
  • 1970-01-01
  • 2010-09-22
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多