异常Canonical-names-should-be-kebabcase-separated-lower

39次阅读

共计 1141 个字符,预计需要花费 3 分钟才能阅读完成。

异常 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

正文完
 0