0.0.10 • Published 5 years ago

typescript-json-schema-faker v0.0.10

Weekly downloads
149
License
MIT
Repository
github
Last release
5 years ago

typescript-json-schema-faker

Build Status npm version

A random data generator for typescript based on https://github.com/json-schema-faker/json-schema-faker

Installation

npm install typescript-json-schema-faker -D

or

yarn add typescript-json-schema-faker -D

Usage

import fake, { JsonSchema } from "typescript-json-schema-faker";

const schema: JsonSchema = {
    id: "someSchemaId",
    type: "object",
    required: ["foo", "bar", "baz"],
    properties: {
        foo: {
            type: "string",
            chance: "guid",
        },
        bar: {
            type: "array",
            minItems: 1,
            maxItems: 10,
            items: {
                type: "number",
            },
        }
        baz: {
            $ref: "otherSchemaId",
        }
    },
};

console.log(fake(schema));

more usage: https://github.com/json-schema-faker/json-schema-faker#supported-keywords

License

MIT

0.0.10

5 years ago

0.0.9

5 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago