Skip to content

Latest commit

 

History

History
34 lines (24 loc) · 931 Bytes

File metadata and controls

34 lines (24 loc) · 931 Bytes

Demo

Use case: schema validation

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:

  1. The user should upload the JSON Schema:
$ curl http://0.0.0.0:9090/schema/schema-id -X POST -d @config-schema.json
  1. The server should respond with status code 201 and:
{"action": "upload", "id": "schema-id", "status": "success"}
  1. 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
  1. The server should "clean" the uploaded JSON Document to remove keys for which the value is null

  2. The server should respond with status code 200 and:

{"action": "validate", "id": "schema-id", "status": "success"}