@ai-sdk/google 2.0.105 → 2.0.107

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.
@@ -187,6 +187,11 @@ function convertJSONSchemaDefinition(jsonSchema, isRoot, referenceContext) {
187
187
  const nonNullTypes = type.filter((t) => t !== "null");
188
188
  if (nonNullTypes.length === 0) {
189
189
  result.type = "null";
190
+ } else if (nonNullTypes.length === 1) {
191
+ result.type = nonNullTypes[0];
192
+ if (hasNull) {
193
+ result.nullable = true;
194
+ }
190
195
  } else {
191
196
  result.anyOf = nonNullTypes.map((t) => ({ type: t }));
192
197
  if (hasNull) {