从nacos用
@ConfigurationProperties(prefix = "whatLed")
获取配置值,报错如下:
Configuration property name ‘whatLed’ is not valid:
Reason: Canonical names should be kebab-case (‘-‘ separated), lowercase alpha-numeric characters and must start with a letter
问题描述:命名不规范
原因:规范名称应为串字型(’-‘分隔),小写字母数字字符,并且必须以字母开头
解决方法:将whatLed重命名为whatled,修改成符合规范的命名,或者用@ConfigurationProperties(prefix = “what-led”)来获取。