> For the complete documentation index, see [llms.txt](https://jack80342.gitbook.io/spring-boot/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jack80342.gitbook.io/spring-boot/iv.-spring-boot-features/24.-externalized-configuration/24.6.-using-yaml-instead-of-properties/24.6.2.-exposing-yaml-as-properties-in-the-spring-environment.md).

# 24.6.2. 在Spring环境中使用YAML暴露属性

`YamlPropertySourceLoader`类能够将YAML作为`PropertySource`导出到Sprig `Environment`，这允许你使用`@Value`注解配合占位符语法访问YAML属性。
