object-root
Category: Structural — overall schema structure triggers this rule
Error Codes
| Profile | Code | Severity |
|---|---|---|
| openai.so.2026-04-30 | OAI-S-object-root | Forbid |
| anthropic.so.2026-04-30 | ANT-S-object-root | Forbid |
Description
The root schema must be of type object
Provider Evidence
| Profile | Status | Source | Basis |
|---|---|---|---|
| anthropic.so.2026-04-30 | documented | Anthropic JSON Schema limitations | — |
| openai.so.2026-04-30 | documented | OpenAI root object | — |
Rationale
Structured-output providers require the top-level schema to be an object.
Bad Example
{
"type": "array",
"items": { "type": "string" }
}
Good Example
{
"type": "object",
"properties": { "name": { "type": "string" } }
}