MattRoss34 / spring-cloud-config

NodeJS configuration management library based on Spring Cloud Config.
ISC License
26 stars 8 forks source link

Unable to parse YAML array from Cloud config #81

Open 4sujittiwari opened 3 years ago

4sujittiwari commented 3 years ago

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"
        ]
      }
    }
  }
}