@mastra/schema-compat 0.11.6-alpha.0 → 0.11.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @mastra/schema-compat
|
|
2
2
|
|
|
3
|
+
## 0.11.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Fix Zod v4 toJSONSchema bug with z.record() single-argument form ([#9355](https://github.com/mastra-ai/mastra/pull/9355))
|
|
8
|
+
|
|
9
|
+
Zod v4 has a bug in the single-argument form of `z.record(valueSchema)` where it incorrectly assigns the value schema to `keyType` instead of `valueType`, leaving `valueType` undefined. This causes `toJSONSchema()` to throw "Cannot read properties of undefined (reading '\_zod')" when processing schemas containing `z.record()` fields.
|
|
10
|
+
|
|
11
|
+
This fix patches affected schemas before conversion by detecting records with missing `valueType` and correctly assigning the schema to `valueType` while setting `keyType` to `z.string()` (the default). The patch recursively handles nested schemas including those wrapped in `.optional()`, `.nullable()`, arrays, unions, and objects.
|
|
12
|
+
|
|
13
|
+
- Improved reliability of string field types in tool schema compatibility ([#9362](https://github.com/mastra-ai/mastra/pull/9362))
|
|
14
|
+
|
|
3
15
|
## 0.11.6-alpha.0
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/schema-compat",
|
|
3
|
-
"version": "0.11.6
|
|
3
|
+
"version": "0.11.6",
|
|
4
4
|
"description": "Tool schema compatibility layer for Mastra.ai",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
"typescript": "^5.8.3",
|
|
61
61
|
"vitest": "^3.2.4",
|
|
62
62
|
"zod": "^3.25.76",
|
|
63
|
-
"@internal/lint": "0.0.
|
|
64
|
-
"@internal/types-builder": "0.0.
|
|
63
|
+
"@internal/lint": "0.0.56",
|
|
64
|
+
"@internal/types-builder": "0.0.31"
|
|
65
65
|
},
|
|
66
66
|
"homepage": "https://mastra.ai",
|
|
67
67
|
"repository": {
|