svelte-jsoneditor icon indicating copy to clipboard operation
svelte-jsoneditor copied to clipboard

custom validator severity

Open Reload0213 opened this issue 2 years ago • 2 comments

I'd like to ask you one more question. The example you example provided in the last question made it possible to use a custom validator.

However No matter what value is delivered as a key value of severity to the validation of the currently customized guidance message, it is output like the yellow "warning" format. As before, I want to pass values ​​like "info", "warning", "error" etc to isolate fatal errors and make them noticeably reddish.

I wonder if I should deliver a value other than "info", "warning", and "error" to the severity key of the customized inspector or not.

Reload0213 avatar Sep 29 '22 06:09 Reload0213

That is a good suggestion indeed, it would be nice to be able to specify the severity coming out of the validator.

Right now, the data models already have a severity field defined, but the UI doesn't utilize this information:

https://github.com/josdejong/svelte-jsoneditor/blob/f70a602d24eff3a57312857a61626ca53a1b2456/src/lib/types.ts#L154-L164

So we should reflect the severity in the rendered validation error table and the inline warning icons (both in text and tree mode).

Help implementing this would be welcome!

josdejong avatar Oct 03 '22 09:10 josdejong

If the ui reflects this point, it will be of great help in using the inspection.

Thank you for listening to me.

Reload0213 avatar Oct 04 '22 02:10 Reload0213

Moving this idea to the Discussions > Ideas section since we are not actively working on it. Help implementing this would be welcome.

josdejong avatar Dec 13 '23 08:12 josdejong