Skip to content

Commit 0f5ab4d

Browse files
committed
fix: remove unused zod-to-json-schema dependency and update JSON schema conversion to use Zod v4's built-in method
1 parent 6fc272b commit 0f5ab4d

2 files changed

Lines changed: 4 additions & 7 deletions

File tree

packages/spec/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,7 @@
112112
"@vitest/coverage-v8": "^4.0.18",
113113
"tsx": "^4.21.0",
114114
"typescript": "^5.3.0",
115-
"vitest": "^4.0.18",
116-
"zod-to-json-schema": "^3.25.1"
115+
"vitest": "^4.0.18"
117116
},
118117
"dependencies": {
119118
"zod": "^4.3.6"

packages/spec/scripts/build-schemas.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import fs from 'fs';
44
import path from 'path';
55
import { z } from 'zod';
6-
import { zodToJsonSchema } from 'zod-to-json-schema';
76
import * as Protocol from '../src/index';
87

98
const OUT_DIR = path.resolve(__dirname, '../json-schema');
@@ -118,10 +117,9 @@ for (const [namespaceName, namespaceExports] of Object.entries(Protocol)) {
118117
const schemaName = key.endsWith('Schema') ? key.replace('Schema', '') : key;
119118

120119
try {
121-
// Convert to JSON Schema
122-
const jsonSchema = zodToJsonSchema(value, {
123-
name: schemaName,
124-
$refStrategy: "none" // We want self-contained schemas for now
120+
// Convert to JSON Schema using Zod v4's built-in toJSONSchema()
121+
const jsonSchema = z.toJSONSchema(value, {
122+
target: 'draft-2020-12',
125123
});
126124

127125
const fileName = `${schemaName}.json`;

0 commit comments

Comments
 (0)