Using YAML for configuration

In a Spring Boot application, the SpringApplication class automatically supports YAML as an alternative to properties. YAML isn't a markup language. It is an alternative to .properties files and it allows you to define properties in the hierarchical configuration. The Java parser for YAML is called SnakeYAML. It must be in the classpath, but it is automatically added to the classpath by spring-boot-starters.

Get Mastering Spring Boot 2.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.