Command line tool

You can use the tool with the provided CLI script.

Pass a filename of an input schema.

compiletojsonschema input.json

The output is printed. To save the output to file, simple redirect it:

compiletojsonschema input.json > output.json

Set a directory for codelists

You can set the directory that is searched for codelists using the –codelist-base-directory or -c flag.

compiletojsonschema -c data/codelists schema.json
compiletojsonschema --codelist-base-directory data/codelists schema.json

Set additional properties false everywhere

To enable this mode, pass the –set-additional-properties-false-everywhere or -s flag.

compiletojsonschema -s input.json
compiletojsonschema --set-additional-properties-false-everywhere input.json