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

Negative number in a list is not handled #70

Open
tapankavasthi opened this issue Mar 29, 2024 · 0 comments
Open

Negative number in a list is not handled #70

tapankavasthi opened this issue Mar 29, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@tapankavasthi
Copy link

tapankavasthi commented Mar 29, 2024

Steps to reproduce

Sample Yaml:

- 123
- 456
- -23

Sample code:

val parsedData: List<Any?> = Yaml.Default.decodeListFromString(yamlStr)

Discrepancy:

Expected [123, 456, -23]
Actual [123, 456, [23]]

For the last entry, the parser treats it as a start of another list, instead of considering it as a negative number.

As per the specs, there must be a space after the dash for a list component.

@Him188 Him188 added the bug Something isn't working label Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants