Copyright 2017-2018 DMTF. All rights reserved.
This tool is deprecated in favor of response payload validation performed by the Redfish-Service-Validator.
Redfish-JsonSchema-ResponseValidator.py is a Python3 utility used to validate any JSON resource against DMTF provided JSON schemas.
Redfish-JsonSchema-ResponseValidator.py usage:
-h display usage and exit
-v verbose
-m directory path to a mockup tree to validate against. default: ./mockup-sim-pull
-s path to a local directory containing the json schema files to validate against. default ./DMTFSchemas
-S Tells resourceValicate to get the schema from http://redfish.dmtf.org/schemas/v1/
-u user name, default root
-p password, default calvin
-e error output path/filename, default ./validate_errs
-f comma separated list of files to validate. If -f is not specified, it will validate all index.json fils in the mockup
-r hostname or IP address [:portno], default None
-i url --used with -r option to specify the url to test, default /redfish/v1
-x comma separated list of patterns to exclude from errors
-g validate only resources which failed a previous run
-l a local json file to validate
NOTE: if -r is specified, this will validate
one resource (rest API) from a host
NOTE: if -f is specified, this will validate individual
resources from the mockup directory
NOTE: if -v is specified, resource JSON will be
printed to std out
NOTE: if -g is specified, input files will be the files
found in a previous error file. If used with -v,
the output will include the resource JSON and the Schema
Dependent modules:
python3.4,
jsonschema,
NOTE: jsonschema should be installable by pip.
# pip3 install jsonschema
# This is the pypy implementation of the standard validator from json-schema.org
requests pip3 install requests
Redfish-JsonSchema-ResponseValidator.py -m mockupdir
-- walks the tree in mockupdir and validate every index.json file found
Redfish-JsonSchema-ResponseValidator.py -r 199.199.199.1[:port] or MyRedfishHost -i /redfish/vi/Systems
-- validates one response from a live service
Redfish-JsonSchema-ResponseValidator.py -g -v [-e errorfile] > saveout
-- validates the resources for a previous error file (-g)
includes in the output the json resource and the json schema
saves the standard out to be examined with an editor
Redfish-JsonSchema-ResponseValidator.py -l LocalResourceFile -S
-- validates the lcoal resources file with the schema from http://redfish.dmtf.org/schemas/v1/
NOTE: here is a shortcut bash script
CHANGELOG.md
with the list of changes since the last releasetool_version
variable in Redfish-JsonSchema-ResponseValidator.py
to reflect the new tool version