Skip to content

Add validate function that reports JSON file line number in error? #156

@cdeil

Description

@cdeil

Would it be possible to add a validate function that takes a JSON file name (or file handle or text ... something where line number info is available) and reports the line number if there is an error?

Maybe there's a trick to embed line number info in the dict generated by the JSON parser? Maybe build a second dict with identical structure, but line numbers as values instead of the actual content?

For my use case I don't care about performance (speed, memory), but it would be very helpful to get a line number in the error.

I'm new to JSON schema, so apologies if this is a stupid and impossible feature request.
The same question was asked before by @BrunoQC here: #90 (comment).

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