1.yaml中缩进不对,原本下级变为同级。
2.yaml中赋值不需要用"",直接赋值
3.实体类中更改后,建议重新Construtor和setter,gettter。
4.检查一下拼写和
@ConfigurationProperties(prefix = "person")的位置。
一般yaml赋值错误就是这些原因了。
1.yaml中缩进不对,原本下级变为同级。
2.yaml中赋值不需要用"",直接赋值
3.实体类中更改后,建议重新Construtor和setter,gettter。
4.检查一下拼写和
@ConfigurationProperties(prefix = "person")的位置。
一般yaml赋值错误就是这些原因了。