Skip to content

Commit c969f22

Browse files
committed
Changelog: proposed for 27.3.0.
1 parent 18e622d commit c969f22

2 files changed

Lines changed: 30 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,32 @@
22

33
## Version 27
44

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+
531
### v27.2.4
632

733
- Fixed performance regression since v24.0.0:

express-zod-api/src/documentation.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@ interface DocumentationParams {
8787
* */
8888
tags?: Parameters<typeof depictTags>[0];
8989
/**
90-
* @desc Limits cartesian product when combining variations.
91-
* @desc Applies to distributed examples and security scheme alternatives.
92-
* @example 0 — disables combinations, but keeps concatenations
90+
* @desc Limits cartesian product when generating examples by combining each property's own examples.
91+
* @desc Applies to: request/response examples, security scheme alternatives.
92+
* @example 0 — disables product combinations, keeps concatenations
9393
* @default Infinity
94-
* @todo set to 20 or 50 in v28
94+
* @todo set to 20 or 50 in v28 to avoid too many combinations
9595
* */
9696
maxCombinations?: number;
9797
}

0 commit comments

Comments
 (0)