44
55### v27.4.0
66
7- - Introduced ` maxCombinations ` setting for Documentation generator:
8- - Limits cartesian product when generating examples by combining each property's own examples;
9- - Set to ` 0 ` to disable product but keep concatenations ;
10- - Default is ` Infinity ` , but may change to reasonable number in v28 to avoid too many combinations;
7+ - Introduced ` limits ` option for Documentation generator with two nested settings :
8+ - ` examples ` — caps the cartesian product when combining each property's own examples;
9+ - ` security ` — caps the cartesian product of security schemas combinations (must be at least 1) ;
10+ - Both default to ` Infinity ` , but will be changed to a reasonable number in v28 to avoid too many combinations;
1111 - Example: 6 props with 2 examples each → cartesian product makes 2^6 = 64 request examples:
1212
1313``` ts
14+ new Documentation ({
15+ // ...other options
16+ limits: { examples: 5 , security: 10 },
17+ });
18+
1419const schema = z .object ({
1520 id: z .number ().example (1 ).example (2 ),
1621 name: z .string ().example (" john" ).example (" jane" ),
@@ -19,7 +24,7 @@ const schema = z.object({
1924 active: z .boolean ().example (true ).example (false ),
2025 tags: z .array (z .string ()).example ([" vip" ]).example ([" new" , " promo" ]),
2126});
22- // First 5:
27+ // First 5 of 64 cartesian combinations :
2328// { id: 1, name: "john", age: 18, role: "user", active: true, tags: ["vip"] },
2429// { id: 1, name: "john", age: 18, role: "user", active: true, tags: ["new", "promo"] },
2530// { id: 1, name: "john", age: 18, role: "user", active: false, tags: ["vip"] },
0 commit comments