014b3f5f96
This undoes a change made in PR #217. Although JSON is a disasterous syntax for human-maintained files, the fact remains that JSON-schema is a thing, whilst YAML-schema (although accepted by swagger) is not. Using YAML negates most of the advantages of using the JSON-schema format (mostly, the fact that we can feed those files into a number of tools), and we weren't really using the increased power of YAML. Possibly, we should consider generating the JSON from YAML inputs, but either way, the event schemas need to refer to the JSON files, and for now it's easier just to stick to JSON. |
||
---|---|---|
.. | ||
examples | ||
schema | ||
README.md | ||
check_examples.py |
README.md
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/m.room.message examples/m.room.message_m.text
schema validation passed
json #1 validation passed