From experimentation, it would appear that Spring Boot 3.x supports both application.yaml and application.yml for external configuration. However the documentation in many places refers to *.yml as the preferred extension. For example:

If you have configuration files with both .properties and .yml format in the same location, .properties takes precedence.

And:

For example, if your application activates a profile named prod and uses YAML files, then both application.yml and application-prod.yml will be considered.

However in other places it refers to *.yaml:

Spring Boot will automatically find and load application.properties and application.yaml files from the following locations when your application starts:

And:

To import these properties, you can add the following to your application.properties or application.yaml file:

Whatever the situation years ago, in 2023 the official recommended extension for YAML files is *.yaml.

  • https://stackoverflow.com/a/54265316
  • https://en.wikipedia.org/wiki/YAML
  • https://yaml.org/faq.html

Yeah, yaml.org is stale, and yeah, some people just like .yml, but surely you agree that the documentation should be consistent. Let's stick with one thing. And as someone pointed out in a comment to a Stack Overflow question, unless you prefer .htm over .html, let's move forward together and use .yaml.

Comment From: scottfrederick

Closing in favor of #34628