Skip to content
Module
Module 3 of 6Lesson 1 of 2~16 min

Write the spec of every field in the schema

An output schema is read by both the model and the engineers, and each expects different things from it. This lesson teaches you to document every field precisely and to spot the rules that the provider will not enforce for you, so the team knows exactly what still needs checking in code.

Lesson objective

By the end of this lesson, you will be able to write an output schema field by field (name, type, required or not, allowed values, description, consumer) and spot the constraints the provider does not guarantee.

Topics covered

  • JSON Schema
  • schema design
  • data types
  • enums

In the glossary

Full glossary

Where it fits

Design the schema

Which fields, which types and which allowed values, and how do I let the model say "I don't know"?

Lessons in this module

  1. Write the spec of every field in the schema (this lesson)
  2. Let the model say "I don't know" in the schema

What you will learn in this module

This lesson is part of the course Get reliable, product-ready AI outputs (JSON, schemas, function calling)

  • Design an output schema (types, enums, required fields, nullable fields, descriptions, "unknown" values) where every field serves a consumer.