Users Pricing

forum

Home Forums How should I represent optional fields in OpenAI strict JSON outputs? – MindStick

How should I represent optional fields in OpenAI strict JSON outputs?

Waldemar Thiessen 60 22 Oct 2026

I’m using OpenAI’s strict JSON output mode for records where some fields genuinely may not exist, such as a middle name or a second address line. I’m unsure whether to make those fields nullable, list every key as required, or leave optional properties out of the schema.

What schema pattern has worked reliably for you, especially when the model should return valid JSON without inventing a value just to fill a field?


0 Answers

Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md