Skip to content

open-contracting/json-schema-random

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JSON Schema random

Given a JSON Schema (draft 04), provide a random valid instance.

Disclaimer

This is an choppy piece of software, that is in need of some care and affection.

TODO

  • format
  • uniqueItems
  • $ref
  • patternProperties
  • dependencies
  • allOf
  • anyOf
  • oneOf
  • not

Install

npm install json-schema-random

Usage

# Return a generated JSON instance to stdout of the JSON_SCHEMA_FILE
json-schema-random JSON_SCHEMA_FILE
# Or, in your source code
generate = require 'json-schema-random'
generate {type: 'number'}

Command-line options

--schemaid - set $schema field to id found in the schema document

--no-additional - don't generate fields for additionalProperties

--no-random - return blank values instead of random

License

Apache 2.0

About

Given a JSON Schema, provide a random valid instance

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • CoffeeScript 92.0%
  • JavaScript 8.0%