【发布时间】:2019-10-24 21:08:54
【问题描述】:
试图将 about yml 转换为 json 。当我尝试这样做时,它正在跳过&,
我正在尝试使用 node 将 yml 转换为 json,反之亦然。
development-mysql: &development-mysql
pool: 5
encoding: utf8
host: 127.0.0.1
port: 1234
alpha: &alpha
<<: *development-mysql
adapter: oracle
database: testDB
username: test
time_zone: UTC
转换成
{
"development-mysql": {
"pool": 5,
"encoding": "utf8",
"host": "127.0.0.1",
"port": 1234
},
"alpha": {
"pool": 5,
"encoding": "utf8",
"host": "127.0.0.1",
"port": 1234,
"adapter": "oracle",
"database": "testDB",
"username": "test",
"time_zone": "UTC"
}
}
当我尝试将它转换回 yml 时是这样的
development-mysql:
pool: 5
encoding: utf8
host: 127.0.0.1
port: 1234
alpha:
pool: 5
encoding: utf8
host: 127.0.0.1
port: 1234
adapter: oracle
database: testDB
username: test
time_zone: UTC
现在理论上这是正确的,但我们有点失去了
【问题讨论】:
标签: json yaml converters