Skip to content

Commit a6d1e8e

Browse files
committed
fix: default to disallow additional properties on objects only
1 parent 6137f7b commit a6d1e8e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

lib/schema.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,10 @@ export class Schema<
6565

6666
public synth() {
6767
return {
68-
additionalProperties: false,
68+
// default to disallow additional properties on objects
69+
...(this.options.schema.type === 'object' && {
70+
additionalProperties: false,
71+
}),
6972
...this.options.schema,
7073
};
7174
}

0 commit comments

Comments
 (0)