Skip to content

Suggestions on post validation line & column information? #340

@ascertrobw

Description

@ascertrobw

One aspect we are really battling with.

How to log line/column information to a user for a YAML document that passes schema validation, but then fails semantic checks on the content of the JSON node tree?

Maybe we're missing something obvious here - but so far we have a multi step process:

  1. Loading the YAML file/stream into JSON and then passing the loaded JSON tree to the factory for validation
  2. Application code for processing the validated Node tree

After step 1 we have effectively lost the original source file information, so if we detect any semantic errors we can't easily report them back to the user with line/col information against the original file.

I doubt this is feasible, but I'm wondering if there couldn't be an option to include meta information in the processed JSON Node tree such as the original source positions of various nodes, which would then allow such error reporting.

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