Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andreineculau/json-schema-random
Given a JSON Schema, provide a random valid instance
https://github.com/andreineculau/json-schema-random
Last synced: 24 days ago
JSON representation
Given a JSON Schema, provide a random valid instance
- Host: GitHub
- URL: https://github.com/andreineculau/json-schema-random
- Owner: andreineculau
- License: apache-2.0
- Created: 2013-04-01T20:01:04.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-09-15T09:19:25.000Z (about 10 years ago)
- Last Synced: 2023-04-12T05:57:31.344Z (over 1 year ago)
- Language: CoffeeScript
- Size: 194 KB
- Stars: 39
- Watchers: 5
- Forks: 10
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
```bash
npm install json-schema-random
```# Usage
```bash
# Return a generated JSON instance to stdout of the JSON_SCHEMA_FILE
json-schema-random JSON_SCHEMA_FILE
``````coffee
# 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