We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0db87c8 commit b0c8265Copy full SHA for b0c8265
1 file changed
src/compileValueSchema.ts
@@ -50,6 +50,15 @@ export function compileValueSchema(
50
additionalProperties: { ...resolved.additionalProperties, ...constraints },
51
});
52
}
53
+
54
+ // Apply the constraints to the items schema if it exists
55
+ if (resolved.type === 'array' && typeof resolved.items === 'object') {
56
+ return compileValueSchema(compiler, {
57
+ ...resolved,
58
+ items: { ...resolved.items, ...constraints },
59
+ });
60
+ }
61
62
// Otherwise merge directly into the resolved schema
63
return compileValueSchema(compiler, { ...resolved, ...constraints });
64
0 commit comments