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

YAML sequence / Array gets its elements split if they have a comma in them #259

Open
melmccann opened this issue Jul 21, 2019 · 2 comments

Comments

@melmccann
Copy link

The first element of the below example "userAgents" gets split into 2 elements at the comma when it is parsed, regardless of whether it is surrounded by single or double quotes.
Can this be prevented, perhaps for single quoted String?

userAgents:
- 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML,like Gecko) Chrome/67.0.3396.99 Safari/537.36'
- 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322)'

@mark-henry
Copy link

mark-henry commented Jul 20, 2022

I also have this problem.

productNames:
 - Automation (57,000)
 - Automation

I also tried

productNames:
 - 'Automation (57,000)'
 - Automation

and

productNames: ['Automation (57,000)', 'Automation']

In all cases, the result was:

config = configurationProvider.bind(...);
// I expect config.productNames().length to be 2, but is 3; the first two elements in the array are "Automation (57" and "000)"

@mark-henry
Copy link

Created a failing test for this issue: master...mark-henry:cfg4j:yaml-commas

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

2 participants