Skip to content

Wrong column on duplicated mapping key exception #452

@hughsw

Description

@hughsw

On this file containing 164 bytes:

VendorContact:
  fields:
    EntityContact: belongsTo

VendorContact:
  fields:
    ContactPerson: belongsTo

This exception:

YAMLException: duplicated mapping key at line 5, column -53:
    VendorContact:
    ^

Column should be 1.

Column calculation appears to be based on offset in some buffer (in this case the distance to the end of the file) rather than the parser position, modulo sign and off-by-one:
Bytes from start of duplicate to end of file: 54

safeLoad()
"js-yaml": "3.12.0",

See also #243 for links to a related, but fixed issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions