Escaping a dot in a Map key in Yaml in Spring Boot

A slight revision of @fivetenwill’s answer, which works for me on Spring Boot 1.4.3.RELEASE:

foo:
  "[bar.com]":
    a: b
  "[baz.com]":
    a: c

You need the brackets to be inside quotes, otherwise the YAML parser basically discards them before they get to Spring, and they don’t make it into the property name.

Leave a Comment