autory test make-schema
Usage: [OPTIONS] JSON_PATH
Convert a .json file into a .json.schema file.
The following Autory-specific assumptions are made:
- extra keys are always allowed
- all numbers have the same error margin
- strings must be exact
- only the given list of keys (if given) are required
This is a utility script to help you create tests. The schema should be
modified manually after creating, as there are usually some things which
cannot be decided automatically.
JSON_PATH: The path to the JSON file from which to derive a JSON schema.
Options:
--schema-path FILE The output file path. If omitted, it will
reside next to the input file, with the same
name, but .schema appended to the extension.
--numeric-error-margin FLOAT The error margin, i.e. how close numbers
should be to the expected value. 0 means that
every number must match exactly.
--included-keys-file FILE A file containing a list of key names. If
given, omit keys that are not in this list
from ALL objects when creating the schema. If
not given, all keys are used and considered
required.
--help Show this message and exit.