How to draft a JSON Schema from documented fields
A JSON Schema draft makes the expected shape of data explicit. It is useful when documentation describes fields but a machine-readable validation starting point is needed.
Start with the right material.
- What you provide
- a visible API response specification.
- The intended result
- Create a JSON Schema draft preserving documented required fields and marking assumptions.
How the workflow works.
Map documented fields to types and requirements, keeping nested objects and arrays clear. Mark assumptions about formats, constraints and schema dialect when the source does not specify them.
What to check in the result.
Validate the schema and try known valid and invalid examples. Do not mark every documented field as required or invent restrictive rules simply because they produce a tidy schema.
Parse the JSON before using it in another application, then inspect its actual values. Valid syntax confirms that a parser can read the structure; it does not confirm that the extracted facts are correct.
Learn from the worked example.
The downloadable example is a JSON object. Compare its structure and missing-value handling with the result you need, then check your own values against the supplied source.
The supplied example is illustrative. It is not a recorded run on your data.
Download the example ↓Use it with your own material.
- Open the source you want to work with and activate WebAct on that tab.
- Copy the task from the hero, add any required fields or preferences, and review the proposed actions.
- Compare the first result with your source. Ask for a specific correction or refinement where needed.