Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/pirosikick/unschema

Generate example JSON from JSON Schema
https://github.com/pirosikick/unschema

json-schema node-js nodejs

Last synced: about 1 month ago
JSON representation

Generate example JSON from JSON Schema

Awesome Lists containing this project

README

        

[![npm version](https://badge.fury.io/js/unschema.svg)](http://badge.fury.io/js/unschema)
[![david](https://david-dm.org/pirosikick/unschema.svg)](https://david-dm.org/pirosikick/unschema)
[![Build Status](https://travis-ci.org/pirosikick/unschema.svg)](https://travis-ci.org/pirosikick/unschema)
[![codecov](https://codecov.io/gh/pirosikick/unschema/branch/master/graph/badge.svg)](https://codecov.io/gh/pirosikick/unschema)

unschema
========

Generate JSON from JSON Schema

## Usage

```js
const unschema = require('unschema');
console.log(unschema({ type: 'string' })); // 'ABCDEFGHIJ'
console.log(unschema({ type: 'number' })); // 0
console.log(unschema({ type: 'boolean' })); // true

console.log(unschema({
type: 'object',
properties: {
a: { type: 'string' },
b: { type: 'number' }
}
});
// => { a: 'ABCDEFGHIJ', b: 0 }
```

## License

[MIT](http://pirosikick.mit-license.org/)