The potential user has two JSON files in the ./docs
folder:
-
Document:
config.json
-
Schema:
config-schema.json
And it expects the Document conforms to the Schema.
To check that it really fits the Schema:
- The user should upload the JSON Schema:
$ curl http://0.0.0.0:9090/schema/schema-id -X POST -d @config-schema.json
- The server should respond with status code 201 and:
{"action": "upload", "id": "schema-id", "status": "success"}
- The user should upload the JSON Document to validate it:
$ curl http://0.0.0.0:9090/validate/schema-id -X POST -d @config.json
-
The server should "clean" the uploaded JSON Document to remove keys for which the value is
null
-
The server should respond with status code 200 and:
{"action": "validate", "id": "schema-id", "status": "success"}