JSON Schema Builder
Infer a conservative JSON Schema from examples and explain uncertain constraints.
Get a draft-2020-12 schema and validation cases.
Free · 2 KB · SKILL.md, instructions and example files. Provide examples and any explicit business constraints; jsonschema is optional for local validation.
A worked example
A small example to try before using your own data.
Input
{
"examples": [
{
"id": 1,
"note": null
},
{
"id": 2,
"note": "ok"
}
],
"contract": "id is required; note is optional; no additional keys"
}Expected result
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"note": {
"type": [
"string",
"null"
]
}
},
"required": [
"id"
],
"additionalProperties": false
}What to check: Both examples validate; an object without id and an object with an extra key are rejected.
Limits: Examples cannot reveal every valid future value. The schema is a proposal until the contract owner confirms it.
Worked example included. Model-specific performance and vendor compatibility have not been benchmarked.
🧠 Why it works
Both examples validate; an object without id and an object with an extra key are rejected.
⚙️ How it works
- Inventory every observed property and type across all examples, including absent keys and null values.
- Require a property only when the supplied contract says it is required; presence in a small sample is not sufficient evidence.
- Use explicit types and item schemas. Do not infer enums, numeric limits or formats from incidental sample values.
- Validate each supplied example and at least one intended rejection case using an available validator.
- List choices that need confirmation, including additional properties and missing versus nullable values.
Description
Get a draft-2020-12 schema and validation cases.
Provide examples and any explicit business constraints; jsonschema is optional for local validation.
Limits: Examples cannot reveal every valid future value. The schema is a proposal until the contract owner confirms it.
Recommended Use
Sign in to suggestTools and workflow packs this skill pairs well with. Forge picks are auto-generated from category + capability signals; Community picks are added by people who've used the pairing.
Forge Auto-recommended matches
Workflow packs
-
Podcast Edit and Release Checklist transform 31%
Move an episode through transcript review, edit decisions and release metadata.
Why: caps 0/0 · io-match · name-mention
-
Localization Review Pack transform 31%
Adapt approved content for a named locale while preserving meaning and required terms.
Why: caps 0/0 · io-match · name-mention
Report compatibility
Tell the community which tool you used this skill with, and whether it worked.
Suggest a pairing
Recommend a tool or workflow pack that this skill works well with. Up to 5 recommendations per day.