Skip to content

Commit 540716d

Browse files
committed
fix: rm default value from higher order functions calling combinations().
1 parent 7b0fb4e commit 540716d

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

express-zod-api/src/documentation.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ interface DocumentationParams {
9292
* @desc Applies to: request/response examples, security scheme alternatives.
9393
* @example 0 — disables product combinations, keeps concatenations
9494
* @default Infinity
95-
* @todo set to 20 or 50 in v28 to avoid too many combinations
95+
* @todo set to 10 or 20 in v28 to avoid too many combinations
9696
* */
9797
maxCombinations?: number;
9898
}
@@ -167,10 +167,10 @@ export class Documentation extends OpenApiBuilder {
167167
brandHandling,
168168
tags,
169169
isHeader,
170+
maxCombinations,
170171
hasSummaryFromDescription = true,
171172
hasHeadMethod = true,
172173
composition = "inline",
173-
maxCombinations = Infinity,
174174
}: DocumentationParams) {
175175
super();
176176
this.addInfo({ title, version });

express-zod-api/src/json-schema-helpers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ export const mergeExamples = (
8686
entry: z.core.JSONSchema.BaseSchema,
8787
{
8888
isOptional,
89-
maxCombinations = Infinity,
89+
maxCombinations,
9090
}: { isOptional: boolean; maxCombinations?: number },
9191
) => {
9292
if (!entry.examples?.length) return;
@@ -143,7 +143,7 @@ export const flattenIO = (
143143
/** @see pullResponseExamples */
144144
export const pullRequestExamples = (
145145
subject: z.core.JSONSchema.ObjectSchema,
146-
limit = Infinity,
146+
limit?: number,
147147
) =>
148148
Object.entries(subject.properties || {}).reduce<FlatObject[]>(
149149
(acc, [key, prop]) => {

express-zod-api/src/logical-container.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export type Alternatives<T> = Array<Combination<T>>;
2727

2828
export const processContainers = <T>(
2929
containers: LogicalContainer<T>[],
30-
maxCombinations = Infinity,
30+
maxCombinations?: number,
3131
): Alternatives<T> => {
3232
const simples = R.filter(isSimple, containers);
3333
const ands = R.chain(R.prop("and"), R.filter(isLogicalAnd, containers));

express-zod-api/src/result-helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export const getPublicErrorMessage = (error: HttpError): string =>
9090
/** @see pullRequestExamples */
9191
export const pullResponseExamples = <T extends z.core.$ZodObject>(
9292
subject: T,
93-
limit = Infinity,
93+
limit?: number,
9494
) =>
9595
Object.entries(subject._zod.def.shape).reduce<FlatObject[]>(
9696
(acc, [key, schema]) => {

0 commit comments

Comments
 (0)