[GH-ISSUE #8462] Enhance JSON Schema Support to Include Arrays and Complex Types #51954

Open
opened 2026-04-28 21:19:52 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @elliottstorey on GitHub (Jan 16, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/8462

The current implementation of JSON schema support in Ollama has limitations when handling arrays and complex data types. For instance, defining a schema with an array of strings ({"type": "array", "items": {"type": "string"}}) is not processed as expected. Expanding the JSON schema support to fully adhere to the JSON Schema specification would allow for more versatile and accurate data representations, aligning Ollama's capabilities with standard practices.

Originally created by @elliottstorey on GitHub (Jan 16, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/8462 The current implementation of JSON schema support in Ollama has limitations when handling arrays and complex data types. For instance, defining a schema with an array of strings (`{"type": "array", "items": {"type": "string"}}`) is not processed as expected. Expanding the JSON schema support to fully adhere to the JSON Schema specification would allow for more versatile and accurate data representations, aligning Ollama's capabilities with standard practices.
GiteaMirror added the feature request label 2026-04-28 21:19:52 -05:00
Author
Owner

@bartvanhoutte commented on GitHub (Mar 13, 2025):

Had something similar, turned out I was encoding the format twice. Works as designed as far as I can tell.

<!-- gh-comment-id:2720669524 --> @bartvanhoutte commented on GitHub (Mar 13, 2025): Had something similar, turned out I was encoding the format twice. Works as designed as far as I can tell.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#51954