Skip to content

JSON Schema: 'definitions' are not supported with output mode 'array' (OpenAI). #6454

Open
@jpkleemans

Description

@jpkleemans

Description

When using the array output mode with generateObject or streamObject, I can't include definitions in the JSON Schema. This is because the package wraps my schema inside its own array schema, preventing access to the root level. Since OpenAI only allows definitions at the root level, this setup causes the following error: Reference can only point to definitions defined at the top level of the schema.

AI SDK Version

  • ai: 4.3.15
  • @ai-sdk/openai: 1.3.22

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions