JSON Schema & Mock
Generate JSON Schema and create mock data from schemas.
Input
Output
Help
Generate JSON Schema and create mock data from schemas.
Show details
Highlights
- JSON → JSON Schema
- Infer required fields, strict objects and formats
- Infer semantic hints and emit optional extensions
- Schema → Mock Data
- Choose between fixed and random sample strategies
JSON-to-Schema Controls
- Required strategy
- `all-observed`: mark every observed field as required
- `none`: emit no `required`
- `array-sample-based`: only keep fields present in every object inside array samples
- Strict objects emit `additionalProperties: false` on object nodes when enabled, and allow extra fields by default when disabled
- Format inference adds standard formats such as `email`, `uri`, `date`, `time`, `date-time`, `uuid`, `ipv4` and `ipv6`
- Semantic inference uses field names and values to infer stronger meaning that can affect the generated schema
- Numeric-string strategy
- `preserve-string`: keep values like `"123"` as strings
- `promote-primitive`: promote safe numeric-like strings toward `integer`, `number` or `boolean` semantics
- Semantic extensions control whether fields such as `x-semantic-type` are emitted
Schema-to-Mock Controls
- Regenerate rotates the internal seed so the same schema can produce another sample
- Value strategy
- `fixed`: return stable example values
- `random`: return seed-driven pseudo-random output
- Array length sets the target size before `minItems` / `maxItems` constraints clamp it
- Property strategy
- `all-properties`: emit all declared properties
- `required-only`: emit only properties listed in `required`
- Field-name fallback keeps inferring semantics such as `email`, `time`, `date-time`, `phone`, `price` and `age` when explicit schema hints are missing
- Semantic string generation prefers `format`, `x-semantic-type` and field-name hints to produce more domain-shaped string values
Common uses
- Generate JSON Schema from a sample JSON payload
- Generate mock data quickly from an existing JSON Schema
- Prepare structure rules and sample payloads for validation, docs or tests
- Chain JSON samples, schema generation and mock data into one modeling flow
Notes
- Schema-to-mock generation resolves local `$ref` entries in `definitions` and `$defs`; external references must be expanded first.
