1 个回答
✓ 已被采纳

原生 YAML 可能不支持,但是 Spring Boot 官方是做了支持的:

Table 4. relaxed binding rules per property source Property Source Simple List

Property SourceSimpleList
Properties FilesCamel case, kebab case, or underscore notationStandard list syntax using [ ] or comma-separated values
YAML FilesCamel case, kebab case, or underscore notationStandard YAML list syntax or comma-separated values
Environment VariablesUpper case format with underscore as the delimiter (see Binding from Environment Variables).Numeric values surrounded by underscores (see Binding from Environment Variables)
System propertiesCamel case, kebab case, or underscore notationStandard list syntax using [ ] or comma-separated values
宣传栏