docs-matrix-spec/event-schemas
Mark Haines 52640eb205 Add a python script for checking that the examples match the event
schema.

Does the same checks as check.sh, but is a *lot* faster making it
suitable for using as a pre-commit hook.

I don't suggest replacing check.sh since it's good to check that the
schema works with multiple implementations of jsonschema.
2015-09-21 13:02:37 +01:00
..
examples/v1 Merge pull request #27 from matrix-org/receipts 2015-09-10 16:18:19 +01:00
schema/v1 Allow relative references to schema to work in python and node. 2015-09-18 11:39:44 +01:00
check.sh Update check.sh now that z-schema returns 1 on error (v3.10.2+) 2015-05-20 14:36:54 +01:00
check_examples.py Add a python script for checking that the examples match the event 2015-09-21 13:02:37 +01:00
README.md Namespace all the things to v1. 2015-05-19 15:28:08 +01:00

Testing a schema

There are many JSON Schema validators you can use to validate incoming events. Not all of them support JSON Schema v4, and some of them have bugs which prevent $ref from being resolved correctly. For basic CLI testing, we recommend and have verified they work with the Node.js package z-schema:

 $ npm install -g z-schema
 $ z-schema schema/v1/m.room.message examples/v1/m.room.message_m.text
 schema validation passed
 json #1 validation passed