@mastra/schema-compat 1.3.5 → 1.3.6-alpha.0

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/dist/index.js CHANGED
@@ -5661,7 +5661,8 @@ var GoogleSchemaCompatLayer = class extends SchemaCompatLayer {
5661
5661
  s["nullable"] = true;
5662
5662
  } else {
5663
5663
  delete s["type"];
5664
- delete s["nullable"];
5664
+ s["anyOf"] = nonNull.map((t) => ({ type: t }));
5665
+ if (hasNull) s["nullable"] = true;
5665
5666
  }
5666
5667
  }
5667
5668
  if (Array.isArray(s["oneOf"])) {
@@ -5691,6 +5692,25 @@ var GoogleSchemaCompatLayer = class extends SchemaCompatLayer {
5691
5692
  s["nullable"] = true;
5692
5693
  }
5693
5694
  }
5695
+ if (!s["type"] && !s["anyOf"] && !s["oneOf"] && !s["allOf"] && !s["$ref"] && !s["enum"] && !s["const"] && !s["properties"] && !s["items"]) {
5696
+ s["anyOf"] = [...[
5697
+ "string",
5698
+ "number",
5699
+ "integer",
5700
+ "boolean",
5701
+ "object"
5702
+ ].map((t) => ({ type: t })), {
5703
+ type: "array",
5704
+ items: { anyOf: [
5705
+ "string",
5706
+ "number",
5707
+ "integer",
5708
+ "boolean",
5709
+ "object"
5710
+ ].map((t) => ({ type: t })) }
5711
+ }];
5712
+ s["nullable"] = true;
5713
+ }
5694
5714
  }
5695
5715
  #traverse(value, schema) {
5696
5716
  const resolved = this.#resolveAnyOf(schema);