@ghentcdh/crouton-api 0.0.1-alpha.47 → 0.0.1-alpha.48

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.cjs CHANGED
@@ -2388,10 +2388,14 @@ var init_view_builder = __esm({
2388
2388
  true
2389
2389
  ]));
2390
2390
  const picked = schema.pick(mask);
2391
- return (0, import_zod22.toJSONSchema)(picked, {
2392
- target: "draft-07",
2393
- ...jsonSchemaOpts
2394
- });
2391
+ try {
2392
+ return (0, import_zod22.toJSONSchema)(picked, {
2393
+ target: "draft-07",
2394
+ ...jsonSchemaOpts
2395
+ });
2396
+ } catch {
2397
+ return void 0;
2398
+ }
2395
2399
  }, "zodSchemaSource");
2396
2400
  NON_NULL_TYPES = [
2397
2401
  "object",
@@ -5061,10 +5065,17 @@ var dropNullableFromRequired2 = /* @__PURE__ */ __name((jsonSchema) => {
5061
5065
  }, "dropNullableFromRequired");
5062
5066
  function toJsonSchema(schema) {
5063
5067
  if (isZodSchema(schema)) {
5064
- const jsonSchema = (0, import_zod29.toJSONSchema)(schema, {
5065
- target: "openApi3",
5066
- ...jsonSchemaOpts
5067
- });
5068
+ let jsonSchema;
5069
+ try {
5070
+ jsonSchema = (0, import_zod29.toJSONSchema)(schema, {
5071
+ target: "openApi3",
5072
+ ...jsonSchemaOpts
5073
+ });
5074
+ } catch {
5075
+ return {
5076
+ type: "object"
5077
+ };
5078
+ }
5068
5079
  dropNullableFromRequired2(jsonSchema);
5069
5080
  return jsonSchema;
5070
5081
  }