OpenAI strict: true JSON Schema fixer

Automatically close every object with additionalProperties: false, convert optional fields to required nullable types, and preserve stripped constraints in descriptions.

Presets
Detected: JSON
{
  "type": "json_schema",
  "json_schema": {
    "name": "create_support_ticket",
    "description": "File a customer support ticket with optional billing context.",
    "strict": true,
    "schema": {
      "title": "CreateSupportTicket",
      "description": "File a customer support ticket with optional billing context.",
      "type": "object",
      "$defs": {
        "CustomerContact": {
          "type": "object",
          "properties": {
            "email": {
              "type": "string",
              "format": "email"
            },
            "locale": {
              "type": [
                "string",
                "null"
              ],
              "description": "(minLength: 2) (maxLength: 5)"
            }
          },
          "required": [
            "email",
            "locale"
          ],
          "additionalProperties": false
        }
      },
      "properties": {
        "subject": {
          "type": "string",
          "description": "(minLength: 5) (maxLength: 120)"
        },
        "priority": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "low",
            "normal",
            "urgent",
            ""
          ]
        },
        "contact": {
          "$ref": "#/$defs/CustomerContact"
        },
        "tags": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "type": "string"
          },
          "description": "(uniqueItems: true)"
        },
        "notes": {
          "type": [
            "string",
            "null"
          ],
          "default": null
        }
      },
      "required": [
        "subject",
        "priority",
        "contact",
        "tags",
        "notes"
      ],
      "additionalProperties": false
    }
  }
}

OpenAI Structured Outputs strict mode rules

When strict: true is enabled on response_format or function tools, OpenAI compiles the schema into a context-free grammar and rejects non-conforming JSON Schema with HTTP 400.

Error pattern Why OpenAI returns 400 SchemaGate auto-fix
Missing additionalProperties: false Every object (root, nested, and inside $defs) must explicitly forbid extra keys. Injects additionalProperties: false recursively across all object nodes.
Optional keys omitted from required Strict mode requires every key in properties to appear in required. Adds missing keys to required and converts each optional schema to nullable.
oneOf or multi-branch allOf Only anyOf is supported for unions; oneOf is rejected. Renames oneOf to anyOf and merges object allOf branches.
minLength, maxLength, uniqueItems Unsupported keywords fail schema validation in strict mode. Strips unsupported keywords and appends constraint notes to description.
Root anyOf or primitive Top-level schema must be type: "object". Flags as Blocked so you can wrap the value in a named root property.