{} LLM JSON Schema View source ↗

OpenAI · Structured Outputs (strict)

Invalid schema for response_format: 'required' is required to be supplied and to be an array including every key in properties.

Strict mode has no optional fields — every property must be required

OpenAI Structured Outputs rejects a schema when any object leaves a property out of its required array. In strict mode, "optional" doesn't exist. Here's the fix, plus the correct way to keep a field effectively optional.

What the error means

With strict: true, OpenAI guarantees the model returns a value for every property you declare. To make that guarantee, it requires that required lists every key in properties, on every object in the schema. Leaving even one key out — the normal JSON-Schema way to mark it optional — triggers this error.

The fix

List every property in required. For a field that genuinely may be absent, don't drop it from required — instead make it nullable so the model can return null:

# before — "nickname" left out of required → rejected { "type": "object", "properties": { "name": { "type": "string" }, "nickname": { "type": "string" } }, "required": ["name"] } # after — nickname stays required, but is nullable { "type": "object", "properties": { "name": { "type": "string" }, "nickname": { "type": ["string", "null"] } }, "required": ["name", "nickname"], "additionalProperties": false }

The mental model

In strict mode you don't make a field optional by omission — you make it optional by allowing null. The key stays in required; the type is what carries the optionality.

Fix it automatically

Paste your schema, pick OpenAI, and the converter forces every property into required and makes the ones you'd left out nullable — each change annotated with the doc rule. All in-browser; nothing uploaded.

Open the converter →
OpenAI Structured Outputs docs ↗