将JSON数据嵌入到YAML文件中

我正在为桌子写夹具。并且其中之一接受JSON字符串作为值。

问题是灯具未加载失败,原因是:

Fixture::FormatError: a YAML error occurred parsing /home/saurajeet/code/dcbox/test/fixtures/hardware.yml. Please note that YAML must be consistently indented using spaces. Tabs are not allowed. Please have a look at http://www.yaml.org/faq.html

The exact error was:

ArgumentError: syntax error on line 145, col 73: ` portslist: [{"name":"ob1","port_num":0,"port_type":"network"},{"name":"ob2","port_nu'.....

任何解决方案。

回答:

我认为将引号括起来应该可以解决问题:

portslist: '[{"name":"ob1","port_type" ... }]'

以上是 将JSON数据嵌入到YAML文件中 的全部内容, 来源链接: utcz.com/qa/422897.html

回到顶部