-
Notifications
You must be signed in to change notification settings - Fork 363
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
numbers with commas in space manifests get parsed as an integer, not a string #2193
Comments
We have created an issue in Pivotal Tracker to manage this: https://www.pivotaltracker.com/story/show/177751284 The labels on this github issue will be updated when the story is started. |
hey it looks like a potential fix was merged into psych. ruby/psych#273 do we need an official release of psych to be cut before testing this new strict_integer functionality? |
Yeah, we are just waiting for a Psych release at this point. |
- in #2807 we manually set psych so we could resolve #2193 - the newer psych is available as a default gem in [ruby 3.2](https://www.ruby-lang.org/en/news/2022/12/25/ruby-3-2-0-released/)
Issue
When pushing an application with the following manifest file:
When they run cf env the variable INTEGER is not handled correctly and is returned as follows:
The commas are removed and the field is parsed as an integer instead of a string. This is different than CF CLI v6's behavior and contrary to the YAML spec definition of an integer (and float): https://yaml.org/spec/1.2/spec.html#id2803828
Context
This is caused by an issue with Ruby's included YAML parsing library, Psych. There is an old issue from 2016 where they note it is not fixed due to backwards compatibility concerns.
Expected result
INTEGER: 1234,567,89
should be parsed as a string (EDIT: actually maybe it should be an array?)Current result
INTEGER: 1234,567,89
is parsed as an integer1234,567,89
Possible Fix
We could make a PR into https://github.com/ruby/psych, or we could switch libraries (if there even are others to choose from).
We could try pre-parsing the YAML before we pass it to Psych, however I would expect that to be difficult and fraught with other issues.
The text was updated successfully, but these errors were encountered: