@ai-sdk/google 3.0.137 → 3.0.138
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 +6 -0
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -1
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +5 -0
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +5 -0
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/convert-json-schema-to-openapi-schema.ts +11 -1
package/package.json
CHANGED
|
@@ -109,8 +109,18 @@ function convertJSONSchemaDefinition(
|
|
|
109
109
|
if (nonNullTypes.length === 0) {
|
|
110
110
|
// Only null type
|
|
111
111
|
result.type = 'null';
|
|
112
|
+
} else if (nonNullTypes.length === 1) {
|
|
113
|
+
// A single type stays a plain node so sibling keywords (items,
|
|
114
|
+
// format, ...) remain valid: Gemini rejects fields beside anyOf and
|
|
115
|
+
// items on a non-array node.
|
|
116
|
+
result.type = nonNullTypes[0];
|
|
117
|
+
if (hasNull) {
|
|
118
|
+
result.nullable = true;
|
|
119
|
+
}
|
|
112
120
|
} else {
|
|
113
|
-
//
|
|
121
|
+
// Multiple non-null types: use anyOf. Type-specific keywords
|
|
122
|
+
// (items, format, ...) still land beside it, which Gemini rejects;
|
|
123
|
+
// splitting them per branch is not handled yet.
|
|
114
124
|
result.anyOf = nonNullTypes.map(t => ({ type: t }));
|
|
115
125
|
if (hasNull) {
|
|
116
126
|
result.nullable = true;
|