OpenAI structured output guide

OpenAI Structured Outputs break when your schema is merely 'valid JSON Schema'.

OpenAI strict mode is powerful, but it is not a generic JSON Schema runtime. Teams regularly discover this after wiring a schema that validates locally and then fails in production.

openai structured outputs additionalProperties falseopenai all fields must be requiredopenai strict json schema optional fields

What breaks

  • Strict mode expects object schemas to pin down their shape instead of leaving extra keys open.
  • Optional-looking properties often need to become required nullable fields to preserve semantics cleanly.
  • Large or deeply nested schemas become fragile fast.

What Schema Gateway fixes

  • Rewrite permissive objects to `additionalProperties: false`.
  • Promote missing properties into `required` and make formerly optional fields nullable.
  • Score compatibility before shipping so CI catches breakage earlier than runtime.

Official references