异常Canonical names should be kebab-case (‘-‘ separated), lowercase alpha-numeric characters and must start with a letter
Description:
Configuration property name 'projectUrl' is not valid:
Invalid characters: 'U'
Bean: projectUrlConfig
Reason: Canonical names should be kebab-case ('-' separated), lowercase alpha-numeric characters and must start with a letter
Action:
Modify 'projectUrl' so that it conforms to the canonical names requirements.
Canonical names should be kebab-case (‘-‘ separated), lowercase alpha-numeric characters and must start with a letter
译:规范名称应为kebab大小写(“-”分隔),小写字母数字字符,并且必须以字母开头
参考SpringBoot官方文档
Relaxed Binding
Spring Boot uses some relaxed rules for binding Environment properties to @ConfigurationProperties beans, so there does not need to be an exact match between the Environment property name and the bean property name. Common examples where this is useful include dash-separated environment properties (for example, context-path binds to contextPath), and capitalized environment properties (for example, PORT binds to port).
轻松绑定
Spring Boot使用一些宽松的规则将Environment属性绑定到@ConfigurationProperties bean,因此不需要在Environment属性名和bean属性名之间进行精确匹配。 这有用的常见示例包括破折号分隔的环境属性(例如,context-path绑定到contextPath)和大写环境属性(例如,PORT绑定到端口)。
projectUrl 应改为 project-url
发表回复