Generates fake JSON with JSON schema.
$ref
supported- CLI command available
forked from leko/json-schema-faker (deprecated)
composer require koriym/json-schema-faker
$schema = json_decode(file_get_contents(__DIR__ . '/schema.json'));
$fake = (new Faker)->generate($schema);
or
// pass SplFileInfo to support local $ref schema file
$fake = (new Faker)->generate(new SplFileInfo(__DIR__ . '/schema.json'));
// convert all json schema jsons in the directory
./vendor/bin/fakejsons {$soruceDir} {$distDir}