File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 55 import JSchema from ' $lib/components/v2/workflow/JSchema.svelte' ;
66 import { tick } from ' svelte' ;
77 import example from ' ./example.json' ;
8+ import { SchemaValidator } from ' $lib/common/jschema_validation' ;
89
910 let schema = undefined ;
1011 let schemaData = {};
3334 schema = undefined ;
3435 jsonSchemaError = ' Invalid JSON' ;
3536 }
37+ const validator = new SchemaValidator ();
38+ if (! validator .loadSchema (schema)) {
39+ schema = undefined ;
40+ jsonSchemaError = ' Invalid JSON Schema' ;
41+ }
3642 }
3743
3844 function handleDataStringChanged () {
Original file line number Diff line number Diff line change 11<script >
22 import { deepCopy } from ' $lib/common/component_utilities' ;
33 import { displayStandardErrorAlert } from ' $lib/common/errors' ;
4+ import { SchemaValidator } from ' $lib/common/jschema_validation' ;
45 import { stripNullAndEmptyObjectsAndArrays } from ' $lib/components/common/jschema/schema_management' ;
56 import JSchema from ' $lib/components/v2/workflow/JSchema.svelte' ;
67 import VersionUpdateFixArgs from ' $lib/components/v2/workflow/VersionUpdateFixArgs.svelte' ;
4445 oldSchema = undefined ;
4546 oldJsonSchemaError = ' Invalid JSON' ;
4647 }
48+ const validator = new SchemaValidator ();
49+ if (! validator .loadSchema (oldSchema)) {
50+ oldSchema = undefined ;
51+ oldJsonSchemaError = ' Invalid JSON Schema' ;
52+ }
4753 }
4854
4955 function handleOldDataStringChanged () {
7682 newSchema = undefined ;
7783 newJsonSchemaError = ' Invalid JSON' ;
7884 }
85+ const validator = new SchemaValidator ();
86+ if (! validator .loadSchema (newSchema)) {
87+ newSchema = undefined ;
88+ newJsonSchemaError = ' Invalid JSON Schema' ;
89+ }
7990 }
8091
8192 /** @type {import('$lib/components/common/StandardErrorAlert.svelte').default|undefined} */
You can’t perform that action at this time.
0 commit comments