Skip to content
This repository was archived by the owner on Nov 8, 2024. It is now read-only.

Commit 6daf858

Browse files
committed
fix(oas2): use schema.minItems in generateBody
1 parent 0d88e53 commit 6daf858

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/openapi2-parser/lib/generator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function generateBody(schema) {
2626
}
2727

2828
if (schemaIsArrayAndHasItems(schema)) {
29-
return [generateBody(schema.items)];
29+
return Array.from({ length: Math.min(5, schema.minItems || 1) }, () => generateBody(schema.items));
3030
}
3131

3232
if (schema.allOf && schema.allOf.length === 1) {

0 commit comments

Comments
 (0)