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
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题