@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.
@@ -219,6 +219,11 @@ function convertJSONSchemaDefinition(jsonSchema, isRoot, referenceContext) {
219
219
  const nonNullTypes = type.filter((t) => t !== "null");
220
220
  if (nonNullTypes.length === 0) {
221
221
  result.type = "null";
222
+ } else if (nonNullTypes.length === 1) {
223
+ result.type = nonNullTypes[0];
224
+ if (hasNull) {
225
+ result.nullable = true;
226
+ }
222
227
  } else {
223
228
  result.anyOf = nonNullTypes.map((t) => ({ type: t }));
224
229
  if (hasNull) {