Generate realistic fake JSON data from JSON Schema definitions with zero production dependencies.
JSON Schema Faker is a library that generates fake JSON data from JSON Schema definitions. It solves the problem of creating realistic mock data for testing APIs, databases, and applications by automatically producing data that conforms to specified schema constraints. The tool supports advanced JSON Schema features and integrates with popular fake data libraries.
Developers and QA engineers who need to generate mock data for testing, prototyping, or development environments, especially those working with JSON-based APIs or data validation systems.
Developers choose JSON Schema Faker for its zero production dependencies, deterministic output via seeded generation, and extensibility through custom formats and integrations with faker.js/chance.js, making it a reliable and flexible tool for data-driven testing.
JSON-Schema + fake data generators
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Supports 2019-09 and 2020-12 drafts with composition keywords like allOf, anyOf, and oneOf, ensuring modern schema compatibility.
Uses seeded PRNG (Mulberry32) for reproducible output across runs, critical for consistent testing and debugging.
Integrates with faker.js and chance.js for realistic data like names and emails, as shown in the extensions example with automatic type casting.
Allows custom format registration via registerFormat() and remote $ref resolution via createRemoteResolver(), enhancing flexibility for complex schemas.
Includes a command-line interface and standalone binaries for Linux, macOS, and Windows, facilitating easy integration into various workflows.
The generate function returns a Promise, which complicates synchronous codebases and requires additional handling for simple use cases.
Rewritten in TypeScript for Bun with migration notes required, indicating potential incompatibilities for older integrations, as mentioned in the README.
Without faker.js or chance.js extensions, built-in format generators are basic, relying on external libraries for realistic data like names and addresses.
Setting up custom keywords with define() and remote resolvers can be intricate, requiring careful handling of context and state, as detailed in the API.