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
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
You can pass this multiple times.
compiletojsonschema -c data/codelists/open -c data/codelists/closed schema.json
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