@composio/json-schema-to-zod 0.1.12 → 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 +8 -3
- package/dist/index.js +8 -3
- package/package.json +1 -1
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
|
-
|
|
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 = propertiesSchema.
|
|
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.
|
|
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
|
-
|
|
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 = propertiesSchema.
|
|
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.
|
|
529
|
+
output = z14.object({});
|
|
525
530
|
}
|
|
526
531
|
}
|
|
527
532
|
if (its.an.anyOf(objectSchema)) {
|