We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b9d1545 commit 10d1ad8Copy full SHA for 10d1ad8
packages/openapi-typescript/src/transform/parameters-array.ts
@@ -87,7 +87,10 @@ export function transformParametersArray(
87
continue;
88
}
89
let optional: ts.QuestionToken | undefined = undefined;
90
- if (paramIn !== "path" && !(resolved as ParameterObject).required) {
+ const isNonOptional =
91
+ (resolved as ParameterObject).required ||
92
+ (options.ctx.makeParametersWithDefaultNotUndefined && resolved.schema?.default !== undefined);
93
+ if (paramIn !== "path" && !isNonOptional) {
94
optional = QUESTION_TOKEN;
95
96
const subType =
0 commit comments