Session 5· 08· 10 min

Fixing Schema Mistakes

What you'll learn
  • See common JSON Schema errors returned by the API
  • Recognise the validation error messages
  • Practice fixing broken schemas quickly

Strict schema mode is picky about what schemas it accepts. This lesson deliberately submits broken schemas and shows the errors you will hit in real life, plus the fix for each.

The 4 most common schema mistakes
1) Required field not in properties 2) Missing additionalProperties: false when strict is true 3) Using "any" type 4) Referencing an undefined type
$ python 08_schema_mistakes_fix.py
Knowledge Check
When strict: true, what is required at every object level in your schema?
Recap — what you just learned
  • Read the exact error message — it always tells you which rule you broke
  • Every object level needs additionalProperties: false in strict mode
  • Every required field must exist in properties
Next up: 09 — Enum & Nullable