> For the complete documentation index, see [llms.txt](https://chloe-codes1.gitbook.io/til/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://chloe-codes1.gitbook.io/til/spring/spring-annotations/13_configurationproperties.md).

# @ConfigurationProperties

> Reference: [Spring Docs - @ConfigurationProperties](https://docs.spring.io/spring-boot/docs/current/reference/html/features.html#features.external-config)

* An annotation that retrieves and binds property values from `*.properties` or `*.yml` files to Java classes
* Using this annotation automatically handles binding for various notation styles
  * ex)

    | acme.my-project.person.first-name   | Recommended notation for properties and .yml                             |
    | ----------------------------------- | ------------------------------------------------------------------------ |
    | acme.myProject.person.firstName     | Standard camel case syntax.                                              |
    | acme.my\_project.person.first\_name | Notation usable in .properties and .yml (dash notation is more standard) |
    | ACME\_MYPROJECT\_PERSON\_FIRSTNAME  | Recommended when using system environment variables                      |
* The property file must be registered as a Bean for it to work properly
