swagger-parser
swagger-parser copied to clipboard
how can I get line number for customer validation
I'm trying to include my custom validator but I need to retrieve the line number of the error. Is that possible?
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.