Skip to content

Negative number in a list is not handled #70

@tapankavasthi

Description

@tapankavasthi

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions