swagger-parser icon indicating copy to clipboard operation
swagger-parser copied to clipboard

how can I get line number for customer validation

Open RolandoNajera opened this issue 6 years ago • 1 comments

I'm trying to include my custom validator but I need to retrieve the line number of the error. Is that possible?

RolandoNajera avatar Jan 21 '19 21:01 RolandoNajera

The validation errors come from z-schema, and they include a details property that provides context about the error. Unfortunately, this doesn't include line numbers. But it does include the JSON path (e.g. "/path/to/some/thing"), which you could use to find the corresponding line number in your original source file.

JamesMessinger avatar Jan 22 '19 10:01 JamesMessinger