Show schema errors with unmapped locations in ace editor mode (#556)#606
Show schema errors with unmapped locations in ace editor mode (#556)#606daggaz wants to merge 1 commit into
Conversation
|
Thanks for your PR @daggaz! Do you have an example of a JSON document and schema were you get these unmapped locations? (so I can easily test your PR?) |
|
@daggaz @josdejong You can try it on the following editor by misspelling the word "image" (for instance): |
|
It's not errors with no path (i.e. It's only really possible if you have a custom validation function that behaves badly. It's also super useful for when you are trying to debug said function... |
|
@daggaz got it. this kind of errors indeed not taken into consideration at the moment. |
|
I like your idea @meirotstein , adding these kind of errors to the top level errors. What do you think @daggaz ? |
|
ping @daggaz |
|
I kinda like that the un-mappable errors are come up very obviously, but I don't have strong feelings either way. The patch we have works, so I vote just do that. |
@daggaz so you mean you would like to keep this PR as it is right now? I'm in favor of not silently hiding errors that don't have a (correct) path, but display them at root node, so at least the user knows that something is wrong. So that would require a change in the PR. What do you think? |
|
Like I said, personally I like that those errors come up in a more obvious/jarring way, but I'm willing to acquiesce. |
|
I'm working on a PR of showing the errors table in code mode in addition to text mode with the option of hiding it - both fixes can provide a quite good solution for this kind of errors. |
|
Sounds good @meirotstein ! I will check out your PR asap but have to do a bit of catch-up after the holidays. @daggaz would that address your issue? |
|
I'm happy |
|
Great. I've merged the improvement of @meirotstein, will close this PR now. |

This PR changes the display of schema/custom errors in "code" view.
Any errors that do not have a valid path are now shown in the
jsoneditor-text-errorstable at the bottom of the editor area.