Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

提示:YML配置字符串应尽量使用双引号 #69

Open
rangerlee opened this issue Apr 1, 2020 · 0 comments
Open

提示:YML配置字符串应尽量使用双引号 #69

rangerlee opened this issue Apr 1, 2020 · 0 comments

Comments

@rangerlee
Copy link

rangerlee commented Apr 1, 2020

虽然YAML可以对字符串值不用引号,但是SpringBoot的YML解析器会把纯数字的字符串解析成数字后转成该数字的字符串,比如 application.yml 中的 password,如果给值 0123456,会按8进制解析成字符串 42798,如果是 0x123456 会按16进制解析为字符串 1193046,造成取得值与实际值不符。因此建议在YML文件字符串类型的都加上双引号,以免造成很难发觉的错误。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant