An open API service indexing awesome lists of open source software.

https://github.com/67p/kosmos-schemas

:warning: [MOVED]
https://github.com/67p/kosmos-schemas

json json-ld json-schema json-schemas kosmos

Last synced: 2 months ago
JSON representation

:warning: [MOVED]

Awesome Lists containing this project

README

        

[![npm](https://img.shields.io/npm/v/@kosmos/schemas)](https://www.npmjs.com/package/@kosmos/schemas)

This repository/module contains [JSON Schema](https://json-schema.org/)
definitions as well as examples for [Kosmos](https://kosmos.org) data formats.

## Usage

You can import these schemas to validate data in JavaScript programs. For
example using npm and the [tv4](https://www.npmjs.com/package/tv4) JSON Schema
validator:

```js
let tv4 = require('tv4');
let schemas = require('kosmos-schemas');

let contributor = {
name: "Tyrion"
}

let result = tv4.validate(contributor, schemas['contributor']);

if (result) {
console.log('Your data is valid');
} else {
console.log('Your data is not valid:');
console.log(tv4.error);
}
```