[PR #14746] docs: update Zod example to use native toJSONSchema #14817

Open
opened 2026-04-13 01:03:10 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/14746
Author: @fuleinist
Created: 3/9/2026
Status: 🔄 Open

Base: mainHead: fix/issue-14734


📝 Commits (1)

  • d82b700 docs: update Zod example to use native toJSONSchema

📊 Changes

1 file changed (+3 additions, -4 deletions)

View changed files

📝 docs/capabilities/structured-outputs.mdx (+3 -4)

📄 Description

Summary

Updates the JavaScript structured outputs example to use Zod v4's native z.toJSONSchema() method instead of the deprecated zod-to-json-schema library.

Changes

  • Updated import to use import * as z from "zod"
  • Changed zodToJsonSchema(Country) to z.toJSONSchema(Country)
  • Removed deprecated zod-to-json-schema import

Testing

  • Verified the syntax is correct for Zod v4
  • Documentation change only, no code changes required

Fixes ollama/ollama#14734


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/14746 **Author:** [@fuleinist](https://github.com/fuleinist) **Created:** 3/9/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/issue-14734` --- ### 📝 Commits (1) - [`d82b700`](https://github.com/ollama/ollama/commit/d82b700d3ff30c4e904a1f9d3ccc6f1c009cd636) docs: update Zod example to use native toJSONSchema ### 📊 Changes **1 file changed** (+3 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `docs/capabilities/structured-outputs.mdx` (+3 -4) </details> ### 📄 Description ## Summary Updates the JavaScript structured outputs example to use Zod v4's native `z.toJSONSchema()` method instead of the deprecated `zod-to-json-schema` library. ## Changes - Updated import to use `import * as z from "zod"` - Changed `zodToJsonSchema(Country)` to `z.toJSONSchema(Country)` - Removed deprecated `zod-to-json-schema` import ## Testing - Verified the syntax is correct for Zod v4 - Documentation change only, no code changes required Fixes ollama/ollama#14734 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-13 01:03:10 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#14817