File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -630,6 +630,26 @@ describe('Zod', () => {
630
630
631
631
describe . only ( 'with z.record' , ( ) => {
632
632
it ( 'should work with additionalProperties for records' , async ( ) => {
633
+ /*
634
+ {
635
+ type: 'object',
636
+ properties: {
637
+ id: { type: 'string' },
638
+ options: {
639
+ type: 'object',
640
+ additionalProperties: {
641
+ type: 'object',
642
+ properties: { label: { type: 'string' } },
643
+ required: [ 'label' ],
644
+ additionalProperties: false
645
+ }
646
+ }
647
+ },
648
+ required: [ 'id', 'options' ],
649
+ additionalProperties: false,
650
+ '$schema': 'http://json-schema.org/draft-07/schema#'
651
+ }
652
+ */
633
653
const schema = z . object ( {
634
654
id : z . string ( ) ,
635
655
options : z . record (
@@ -642,8 +662,6 @@ describe('Zod', () => {
642
662
)
643
663
} ) ;
644
664
645
- console . dir ( zod ( schema ) . jsonSchema , { depth : 10 } ) ; //debug
646
-
647
665
let row = {
648
666
id : '1' ,
649
667
options : {
You can’t perform that action at this time.
0 commit comments