@composio/json-schema-to-zod 0.1.11 → 0.1.13

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
@@ -546,10 +546,15 @@ function parseObject(objectSchema, refs) {
546
546
  if (additionalProperties instanceof z14.ZodNever) {
547
547
  output = propertiesSchema.strict();
548
548
  } else {
549
- output = propertiesSchema.catchall(additionalProperties);
549
+ const isEmptyObject = Object.keys(propertiesSchema._def.shape()).length === 0;
550
+ if (isEmptyObject) {
551
+ output = propertiesSchema.passthrough();
552
+ } else {
553
+ output = propertiesSchema.catchall(additionalProperties);
554
+ }
550
555
  }
551
556
  } else {
552
- output = zodSchema;
557
+ output = propertiesSchema.passthrough();
553
558
  }
554
559
  } else {
555
560
  if (hasPatternProperties) {
@@ -557,7 +562,7 @@ function parseObject(objectSchema, refs) {
557
562
  } else if (additionalProperties) {
558
563
  output = z14.record(additionalProperties);
559
564
  } else {
560
- output = z14.record(z14.any());
565
+ output = z14.object({});
561
566
  }
562
567
  }
563
568
  if (its.an.anyOf(objectSchema)) {
package/dist/index.js CHANGED
@@ -510,10 +510,15 @@ function parseObject(objectSchema, refs) {
510
510
  if (additionalProperties instanceof z14.ZodNever) {
511
511
  output = propertiesSchema.strict();
512
512
  } else {
513
- output = propertiesSchema.catchall(additionalProperties);
513
+ const isEmptyObject = Object.keys(propertiesSchema._def.shape()).length === 0;
514
+ if (isEmptyObject) {
515
+ output = propertiesSchema.passthrough();
516
+ } else {
517
+ output = propertiesSchema.catchall(additionalProperties);
518
+ }
514
519
  }
515
520
  } else {
516
- output = zodSchema;
521
+ output = propertiesSchema.passthrough();
517
522
  }
518
523
  } else {
519
524
  if (hasPatternProperties) {
@@ -521,7 +526,7 @@ function parseObject(objectSchema, refs) {
521
526
  } else if (additionalProperties) {
522
527
  output = z14.record(additionalProperties);
523
528
  } else {
524
- output = z14.record(z14.any());
529
+ output = z14.object({});
525
530
  }
526
531
  }
527
532
  if (its.an.anyOf(objectSchema)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@composio/json-schema-to-zod",
3
- "version": "0.1.11",
3
+ "version": "0.1.13",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",