Command line tools validates an ECJson or ECXml schema.
npm install @bentley/schema-validatorsh
npm install -g @bentley/schema-validator
schema-validator -i C:\Path\To\Schema\Domain.ecschema.xml -o C:\Desired\Output\Path\ -r C:\Reference\Path1 -r C:\Reference\Path2
`
Getting Started
$3
Install globally:
`sh
npm install -g @bentley/schema-validator
`
$3
Required Parameters:
-i, --input {path}: The path to an XML or JSON EC Schema file OR a directory holding the same (all .ecschema.xml and .ecschema.json files found will be validated).
-o, --output {path}: Directory to put the validation output file in the format 'MySchema.ecschema.xml.result.txt'.
Optional Parameters:
-r, --ref {path}: Optional path to search when locating schema references. Example: -r c:\\dir1 -r c:\\dir2;
-a, --all: Validate the entire schema graph.
For help use the '-h' option.
To validate an ECSchema, run:
`sh
schema-validator -i C:\Path\To\Schema\Domain.ecschema.xml -o C:\Desired\Output\Path\ -r C:\Reference\Path1 -r C:\Reference\Path2
`
Updating to new version
Since the package is installed globally, updating has a different syntax than normal. To update the package globally, run:
`sh
npm update -g @bentley/schema-validator
``