Skip to main content
Good schema design matters more than model choice for reliable structured outputs.

Start simple

  • Prefer flat objects over deeply nested structures.
  • Use required for every field you need.
  • Set additionalProperties: false when you need strict shape control.

Request

Response

Common mistakes

  • Optional fields that should be required.
  • Overly broad string fields instead of enum constraints.
  • Schema drift between docs and server-side validator.
Last modified on July 26, 2026