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 40c2e9e commit 3f0607eCopy full SHA for 3f0607e
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