object
. The top-level element of the schema must be object
.
Correct:
object
or array
as one of the options. Agentic Document Extraction does not allow type arrays to contain these complex data types because they can create validation conflicts and ambiguous schema definitions.
A type array allows a field to accept multiple data types. For example, "type": ["string", "number"]
means the field can contain either a text value or a numeric value. However, when you include “object
” or “array
” in a type array, the schema becomes difficult to validate consistently.
Common scenarios that trigger this error:
"type": ["number", "object"]
"type": ["string", "array"]
"type": ["object", "array"]
anyOf
construct. The anyOf
keyword provides a clearer and more flexible way to specify that a field can match any one of several schema definitions. This approach eliminates the validation ambiguity that occurs with complex types in type arrays.
Correct:
allOf
not
dependentRequired
dependentSchemas
if
then
else
properties
) are not defined for object
types in the extraction schema.
To fix this issue, define the properties
field for all object types in the schema.
Correct:
items
definition.
To fix this issue, define the fields in the array with items
.
Correct: