|
2 | 2 |
|
3 | 3 | ## Version 27 |
4 | 4 |
|
| 5 | +### v27.3.0 |
| 6 | + |
| 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; |
| 11 | + - Example: 6 props with 2 examples each → cartesian product makes 2^6 = 64 request examples: |
| 12 | + |
| 13 | +```ts |
| 14 | +const schema = z.object({ |
| 15 | + id: z.number().example(1).example(2), |
| 16 | + name: z.string().example("john").example("jane"), |
| 17 | + age: z.number().example(18).example(21), |
| 18 | + role: z.enum(["user", "admin"]).example("user").example("admin"), |
| 19 | + active: z.boolean().example(true).example(false), |
| 20 | + tags: z.array(z.string()).example(["vip"]).example(["new", "promo"]), |
| 21 | +}); |
| 22 | +// First 5: |
| 23 | +// { id: 1, name: "john", age: 18, role: "user", active: true, tags: ["vip"] }, |
| 24 | +// { id: 1, name: "john", age: 18, role: "user", active: true, tags: ["new", "promo"] }, |
| 25 | +// { id: 1, name: "john", age: 18, role: "user", active: false, tags: ["vip"] }, |
| 26 | +// { id: 1, name: "john", age: 18, role: "user", active: false, tags: ["new", "promo"] }, |
| 27 | +// { id: 1, name: "john", age: 18, role: "admin", active: true, tags: ["vip"] }, |
| 28 | +// ...and 59 more |
| 29 | +``` |
| 30 | + |
5 | 31 | ### v27.2.4 |
6 | 32 |
|
7 | 33 | - Fixed performance regression since v24.0.0: |
|
0 commit comments