svelte-jsoneditor
svelte-jsoneditor copied to clipboard
custom validator severity
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.
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!
If the ui reflects this point, it will be of great help in using the inspection.
Thank you for listening to me.
Moving this idea to the Discussions > Ideas section since we are not actively working on it. Help implementing this would be welcome.