Skip to content

JSON Schema

JSON Schema describes the structure and constraints of JSON data. A validator checks these rules; conformance alone does not establish business correctness.

APIs and data contracts

JSON Schema is a language for describing the structure and constraints of JSON data. These include data types and rules for properties. A validator can check whether specific data conforms to the supplied schema.

Distinguish valid JSON from suitable data

In a fictional order intake, the quantity field must contain an integer. The numeric value 2 and the string "2" are different value types. A syntactically valid JSON document therefore does not automatically meet the agreed field rule.

Define required fields explicitly

The JSON Schema documentation explains that listed properties are not automatically required. Required information must be specified accordingly in the schema. The overview describes checking with a validator. Even a passed schema check does not confirm that the quantity belongs to the right order or has been processed in the ERP. Checking the structure, matching to the correct order and confirming successful processing each require suitable evidence.

Sources