diff --git a/schema-validation.sh b/schema-validation.sh new file mode 100644 index 0000000..1ac1ba6 --- /dev/null +++ b/schema-validation.sh @@ -0,0 +1,13 @@ +#!/bin/sh -e + +# install AJV: +npm init -y +npm install ajv +npm install ajv-cli +npm install ajv-formats + +# validate schema using AJV: +TS_LIONCORE_M3_SCHEMA=../repos/lionweb-typescript/packages/artifacts/schemas/lioncore_m3.serialization.schema.json +JAVA_LIONCORE_SERIALIZATION=../repos/lionweb-java/core/src/test/resources/serialization/lioncore.json +./node_modules/.bin/ajv -c ajv-formats --spec=draft2020 --strict=true --allErrors=true --allowUnionTypes=true test -s $TS_LIONCORE_M3_SCHEMA -d $JAVA_LIONCORE_SERIALIZATION --valid + diff --git a/test.sh b/test.sh index 41c17c9..b8fbb6c 100755 --- a/test.sh +++ b/test.sh @@ -2,14 +2,3 @@ deno task run-tests -# install AJV: -npm init -y -npm install ajv -npm install ajv-cli -npm install ajv-formats - -# validate schema using AJV: -TS_LIONCORE_M3_SCHEMA=../repos/lionweb-typescript/packages/artifacts/schemas/lioncore_m3.serialization.schema.json -JAVA_LIONCORE_SERIALIZATION=../repos/lionweb-java/core/src/test/resources/serialization/lioncore.json -./node_modules/.bin/ajv -c ajv-formats --spec=draft2020 --strict=true --allErrors=true --allowUnionTypes=true test -s $TS_LIONCORE_M3_SCHEMA -d $JAVA_LIONCORE_SERIALIZATION --valid -