ponzi

0.0.4 • Public • Published

a true inspiration

Ponzi

We needed a quick way to generate schema's for objects so that ETL's further down the pipe would know how to parse the darn things.

usage

var Ponzi = require('ponzi');

var schema = Ponzi.toSchema({ aString : 'abc',
                              aNumber : 123, 
                              anObject : { hello : 'world'},
                              anArray  : [1, 2, 3] });

<!-- yields
{ type: 'object',
  properties: 
   { aNumber: { type: 'number' },
     aString: { type: 'string' },
     anArray: { type: 'array', items: [Object] },
     anObject: 
      { type: 'object',
        '$ref': '211b43b6a3324ea9dd280dfb567fedb8' } },
  definitions: { '211b43b6a3324ea9dd280dfb567fedb8': { type: 'object', properties: [Object] } } } -->

known bummers

Arrays containing different datatypes will yield little information. ie) type : 'mixed' (which is not super helpful);

Readme

Keywords

none

Package Sidebar

Install

npm i ponzi

Weekly Downloads

4

Version

0.0.4

License

none

Last publish

Collaborators

  • stowns