matrix-doc/event-schemas
Richard van der Hoff 014b3f5f96 Make the schema files JSON
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.
2016-05-04 18:25:24 +01:00
..
examples m.third_party_invite: Allow multiple public keys 2016-02-12 13:15:21 +00:00
schema Make the schema files JSON 2016-05-04 18:25:24 +01:00
README.md Flatten out v1 and v2_alpha directories 2015-11-30 11:22:57 +00:00
check_examples.py Make all the schema files yaml 2015-12-07 13:56:36 +00:00

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