koriym / json-schema-faker
Generates fake JSON with JSON schema
Installs: 330 185
Dependents: 1
Suggesters: 0
Security: 0
Stars: 7
Watchers: 5
Forks: 8
Open Issues: 0
Requires
- php: >=7.1.0
- ext-json: *
- ext-mbstring: *
- fakerphp/faker: ^1.13
Requires (Dev)
- doctrine/coding-standard: ^12
- justinrainbow/json-schema: ^6.0
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2024-10-23 01:15:56 UTC
README
Generates fake JSON with JSON schema.
$ref
supported- CLI command available
forked from leko/json-schema-faker (deprecated)
Getting started
composer require koriym/json-schema-faker
Usage
$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'));
Command
// convert all json schema jsons in the directory
./vendor/bin/fakejsons {$soruceDir} {$distDir}