JSON Schema Sample Builder
Generate a deterministic sample for a supported JSON Schema subset.
Processing stays in your browser. Draft-07 subset, finite local schemas and at most 20 generated array items. Unsupported compositions can produce a clear validation error instead of a fabricated valid example.
How to use the json schema sample builder
Review json schema using the supplied worked example. Replace the example with your own data and choose Run tool. Inspect the result against the method below before copying or downloading it. Editing an input clears the previous result.
How the tool works
The generator prefers const, enum, default and examples before building values from declared types. Objects include declared properties and arrays honor bounded minimum length. The generated sample is checked with Ajv.
Worked example
View the example inputs
- JSON Schema
- {"type": "object", "required": ["name", "count"], "properties": {"name": {"type": "string"}, "count": {"type": "integer", "minimum": 3}}}
A required integer count with minimum 3 produces count: 3 in the sample object.
Good to know
Draft-07 subset, finite local schemas and at most 20 generated array items. Unsupported compositions can produce a clear validation error instead of a fabricated valid example.
Sources and implementation notes
Implemented by DevBricks Technologies. Method notes updated . References describe the underlying format, method or API. Local processing runs on your device. Any public provider queries are described above and start when you run the lookup.
Work with structured data without losing meaning
Keep a copy of the original document before formatting or converting it. Identify whether the input is one object, an array, or a stream of separate records: these are different structures. JSON uses double quotes for strings and property names, and does not support comments, trailing commas or undefined values. A document that parses successfully can still contain the wrong fields or values for your application.
Inputs and settings explained
- JSON Schema
- Supply the JSON shape named by this label. Preserve property names and value types in the example, then replace the demonstration data. Objects, arrays and newline-delimited records are different formats; use the one requested rather than enclosing arbitrary text in braces.
See the demonstration value
{"type": "object", "required": ["name", "count"], "properties": {"name": {"type": "string"}, "count": {"type": "integer", "minimum": 3}}}
How to review the result
Compare structure as well as appearance. Check whether numbers stayed numbers, null stayed distinct from an empty string, and arrays retained their order. Very large integers require particular care when a JavaScript number parser is involved; use the representation your receiving system expects. Formatting changes whitespace, whereas conversion between formats can change the available data types. Test the result with the actual consumer before replacing a working configuration or API fixture.
- Compare a nested object, an empty array and a non-ASCII string with the original.
- Look for repeated keys, missing required properties and unintended type changes.
- Validate against your application's schema separately when one is available.
Common questions about this workflow
Does valid JSON mean my API request is correct?
No. Parsing checks the JSON syntax. Your API can still reject an unsupported property, an incorrect type, missing authorization or a value outside its allowed range. Compare the output with the endpoint's documented contract.
What should I do when the input fails?
Start with the smallest failing object. Check the reported location and the preceding line for a missing comma, unmatched quote or bracket. Fix the source rather than deleting data merely to make the parser accept it.
Built by DevBricks Technologies. Found an unexpected result in JSON Schema Sample Builder? Report a reproducible example with the tool URL, settings and a small sample that contains no private information.