原生 YAML 可能不支持,但是 Spring Boot 官方是做了支持的:Table 4. relaxed binding rules per property source Property Source Simple ListProperty SourceSimpleListProperties FilesCamel case, kebab case, or underscore notationStandard list syntax using [ ] or comma-separated valuesYAML FilesCamel case, kebab case, or underscore notationStandard YAML list syntax or comma-separated valuesEnvironment 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
原生 YAML 可能不支持,但是 Spring Boot 官方是做了支持的:
Table 4. relaxed binding rules per property source Property Source Simple List
[ ]
or comma-separated values[ ]
or comma-separated values