Search code examples
springyamlspring-cloud-config

Can´t use sequences/lists in YAML with Spring Cloud Config


I´m having problems using an (apparently) valid YML file with Spring Cloud Config as soon as I try to use anything like list or sequences.

Some dummy YML samples. This one works when I hit the endpoint exposed by the server:

info:
   description: "This is the collector for CEM"
   git-commit: "bla bla MD5"
   version: "0.2.0-SNAPSHOT"

This one does not work:

info:
   description: "This is the collector for CEM"
   git-commit: "bla bla MD5"
   version: "0.2.0-SNAPSHOT"
   items: [ "a", "b", "c"]

Tried this as well:

info:
   description: "This is the collector for CEM"
   git-commit: "bla bla MD5"
   version: "0.2.0-SNAPSHOT"
   items:
       - "a"
       - "b"
       - "c"

The error I get with the second and third examples is this one:

This page contains the following errors:

error on line 1 at column 462: StartTag: invalid element name
Below is a rendering of the page up to the first error.

What would be the correct way of using lists/sequences? I am mostly interested in lists of complex objects and, unfortunately, the samples provided are almost always one-liners.

Cheers!

Update: I fixed a badly written example (the third one). I still does not work.

Update 2: This is actually an issue with the HTML renderer and not with the functionality of the config server itself, as it passes the config to the client without issue. However the HTML is a nice-to-have as it gives you visual information on what is being loaded.

Update 3: I´m using Spring Cloud Brixton.SR7


Solution

  • The issue seems to be removed pulling the latest version of Spring Cloud Config. However, now JSON is displayed instead of XML.