spring-cloud-config
spring-cloud-config copied to clipboard
Unable to parse YAML array from Cloud config
Below is my cloud-config in YAML format :
cert:
abc:
us:
usesExclusion: false
included: [
'1149043',
'1127938',
'13658',
'107076'
]
When the above YAML is parsed in my node app as JSON
{
"cert": {
"abc": {
"us": {
"usesExclusion": false,
"included[0]": "1149043",
"included[1]": "1127938",
"included[2]": "13658",
"included[3]": "107076"
}
}
}
}
It's not parsing as an array it's just adding the key with an index number. This doesn't happen when the local application file is parsed, the reason for this is that you are using JS-YAML library for parsing local application.yml.
Expected:
{
"cert": {
"abc": {
"us": {
"usesExclusion": false,
"included": [
"1149043",
"1127938",
"13658",
"107076"
]
}
}
}
}