Affects: 5.2.15.RELEASE
The origin of the problem is this issue: I use nacos to read config,However, it does not conform to the expected value
🚶
When i use '@Value ' to read my config, the value does not match my real config
The value in method args is String,and in yml is 000415. But the injected value is 269,It may be converted into a String
🌞
I tracked the source code,and I find some question(may be is a bug) in
org.springframework.beans.factory.config.YamlPropertiesFactoryBean#createProperties
When parsing to yml, 000415, which should be of String type, is parsed into integer type,And what I actually get is 269. Can we add a feature to specify that the actual types of all values or some values are strings to avoid the problem that the parsed values do not match the expected values?
Comment From: snicoll
@Cocowwy that's out of our control, you need to quote the original value in the yaml configuration to avoid YAML to convert it to a number.