0.0.9 • Published 10 years ago

js-json-schema v0.0.9

Weekly downloads
1
License
BSD-2-Clause
Repository
github
Last release
10 years ago

js-json-schema

JS to JSON schema generator

 var Address = function(){};
 Address.prototype.attributes = ["addressLine1", "addressLine2", "city", "postcode:Integer", "country"];
 
 var User = function(){};
 User.prototype.attributes = ["name", "email", "password", "address:Address", "active:enum Active,Inactive"];
 User.prototype.extend = {};
 User.prototype.extend.staffUser = ["staffId", "department"];
 User.prototype.extend.member = ["memberId"];
 
 var types = {User:User, Address:Address};

using top down approach

 require('js-json-schema').topdown.generate({schemaDir:'td-schema', ext:'.schema.json'});

using bottom up approach

 require('js-json-schema').bottomup.generate({schemaDir:'bu-schema', ext:'.schema.json'});
0.0.9

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago