fix: json schema validation 'no validation' reset errors

This commit is contained in:
ShareVB committed 2025-12-14 20:07:05 +01:00
1 parent fbe9c58cc4
commit b700c2cfdd
1 file changed
+4
@@ -22,6 +22,10 @@ export function useJsonSchemaValidation({ json, schemaUrl, schemaData }: { json:
});
watch([schemaUrl, schemaData].filter(isRef), async () => {
if (get(schemaUrl) === '') {
schema.value = null;
errors.value = [];
}
if (get(schemaUrl) === 'custom') {
try {
schema.value = JSON.parse(get(schemaData)) as Schema;