A data type definition language for YAML, JSON, CSV and more.
SchemaType is designed to be easy for people to work with. Easy to read and easy to write, but also easy to use, fork, extend, publish, share and maintain. The SchemaType syntax is YAML based combined with a nice, compact DSL. Schemas can be published and referenced from source control such as GitHub.
SchemaType even lets you create and maintain schemas automatically. By looking analyzing existing data, SchemaType can generate new schemas or make suggestions for improvemnt on existing ones.
How SchemaType Works →SchemaType definitions are meant to be published and reused. Even the most core types are no different from types you make yourself. If a schema is close to what you want, reference it as a base and add the extra properties. If there is a bug in a core schema, fork it, fix it, use the fork, submit a patch or pull request.
SchemaType makes using and maintaining schema information work the same as using and maintaining source code. Schemas act like OO classes; they support subclassing, inheritance, polymorphism etc.
SchemaType Examples →Think about it... The more specifically you define data, the less code you need to write. Schemas can not only validate data, they can generate all sorts of functionality that would otherwise need to be done by hand. SchemaType aims to make a future where all data is defined and can be reasoned on precisely (both by people and by computers).
Every schema and type defined by SchemaType is (expands to) an immutable URL reference. This makes your schemas themselves be immutable and therefore trustable by others.
SchemaType Usage →Quick-start Instructions
$ npm install schematype
$ schematype --help
$ schematype generate -i my.yaml -o my.stp
$ schematype validate -s my.stp my.yaml
YAML is valid ✓