Skip to content

Commit 9c32052

Browse files
committed
Use default parameter for default middlware merge strategy
1 parent f102f02 commit 9c32052

16 files changed

Lines changed: 32 additions & 48 deletions

File tree

modules/openapi-generator/src/main/resources/typescript/configuration.mustache

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,11 @@ export function mergeConfiguration(conf: Configuration, options?: ConfigurationO
121121
};
122122
}
123123

124-
function mergeMiddleware(staticMiddleware: Middleware[], calltimeMiddleware?: Middleware[], strategy?: "append" | "prepend" | "replace") {
124+
function mergeMiddleware(staticMiddleware: Middleware[], calltimeMiddleware?: Middleware[], strategy: "append" | "prepend" | "replace" = "replace") {
125125
if (!calltimeMiddleware) {
126126
return staticMiddleware;
127127
}
128-
// default to replace behavior
129-
switch(strategy ?? "replace") {
128+
switch(strategy) {
130129
case "append":
131130
return staticMiddleware.concat(calltimeMiddleware);
132131
case "prepend":

samples/client/echo_api/typescript/build/configuration.ts

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/client/others/typescript/builds/array-of-lists/configuration.ts

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/client/others/typescript/builds/enum-single-value/configuration.ts

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/client/others/typescript/builds/null-types-simple/configuration.ts

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/client/others/typescript/builds/with-unique-items/configuration.ts

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/client/others/typescript/encode-decode/build/configuration.ts

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/openapi3/client/petstore/typescript/builds/browser/configuration.ts

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/openapi3/client/petstore/typescript/builds/composed-schemas/configuration.ts

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

samples/openapi3/client/petstore/typescript/builds/default/configuration.ts

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)