openfga / language

Grammar for the OpenFGA modeling language
https://openfga.dev
Apache License 2.0
17 stars 7 forks source link

Map errors raised by `validateJSON` back to their original source files #186

Closed ewanharris closed 6 months ago

ewanharris commented 7 months ago

When we run the fully combined model through validateJSON currently the errors have no metadata associated with them that would allow us to (or at least easily) look up the line and column information associated with the error.

When we raise a validation error we should include the new file and module metadata fields so that we can improve the error reporting for these errors. Then in the catch for validateJSON we can lookup the file contents and get line/column data to improve these errors.

ewanharris commented 6 months ago

Current status of error types (as listed in errors.ts):