apiaryio / dredd

Language-agnostic HTTP API Testing Tool
https://dredd.org
MIT License
4.19k stars 280 forks source link

Provide line/column numbers for compiler annotations #1582

Open honzajavorek opened 5 years ago

honzajavorek commented 5 years ago

Unline errors and warnings (annotations) coming from the parser, the ones coming from the compiler currently don't provide line/column numbers. Instead, they provide at least the origin of the relevant transaction. It would be great if they could give users exact pointers to the original document about what went wrong and what to fix.

This is a problem in case we rely on API Elements providing us with line/column numbers, as they are only provided with parser annotations by default. For compiler annotations we would have to calculate the numbers from source maps ourselves, but that's not trivial. For that reason this feature request waits for the parser toolchain to provide means how to calculate the line/column numbers in a blackbox, uniform way, for any API description format, for any element in the API Elements parse result.

This was previously discussed with @kylef and I think we agreed this is something they would eventually want to do in @apiaryio/adt.

honzajavorek commented 5 years ago

Dredd issue about this: https://github.com/apiaryio/dredd/issues/1306