Skip to content

Commit 341ad1f

Browse files
wing328szTheory
andauthored
[TypeScript Fetch] Default TypeScript fetch configuration to 3.6+ true #9974 (#11331)
* Default TypeScript fetch configuration to 3.6+ true, as it's been out for a while now * TypeScript fetch update the three plus CLI option default to true * Apply doc generator patch * Build the project and update samples * remove VERSION * test ts fetch clients first * Revert "test ts fetch clients first" This reverts commit 590a7f2. Co-authored-by: szTheory <[email protected]>
1 parent 156868e commit 341ad1f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

docs/generators/typescript-fetch.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
3737
|sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true|
3838
|sortParamsByRequiredFlag|Sort method arguments to place required parameters before optional parameters.| |true|
3939
|supportsES6|Generate code that conforms to ES6.| |false|
40-
|typescriptThreePlus|Setting this property to true will generate TypeScript 3.6+ compatible code.| |false|
40+
|typescriptThreePlus|Setting this property to true will generate TypeScript 3.6+ compatible code.| |true|
4141
|useSingleRequestParameter|Setting this property to true will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter.| |true|
4242
|withInterfaces|Setting this property to true will generate interfaces next to the default class implementations.| |false|
4343
|withoutRuntimeChecks|Setting this property to true will remove any runtime checks on the request and response payloads. Payloads will be casted to their expected types.| |false|

modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptFetchClientCodegen.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public class TypeScriptFetchClientCodegen extends AbstractTypeScriptClientCodege
4747
private boolean prefixParameterInterfaces = false;
4848
protected boolean addedApiIndex = false;
4949
protected boolean addedModelIndex = false;
50-
protected boolean typescriptThreePlus = false;
50+
protected boolean typescriptThreePlus = true;
5151
protected boolean withoutRuntimeChecks = false;
5252

5353
// "Saga and Record" mode.
@@ -93,7 +93,7 @@ public TypeScriptFetchClientCodegen() {
9393
this.cliOptions.add(new CliOption(WITH_INTERFACES, "Setting this property to true will generate interfaces next to the default class implementations.", SchemaTypeUtil.BOOLEAN_TYPE).defaultValue(Boolean.FALSE.toString()));
9494
this.cliOptions.add(new CliOption(CodegenConstants.USE_SINGLE_REQUEST_PARAMETER, CodegenConstants.USE_SINGLE_REQUEST_PARAMETER_DESC, SchemaTypeUtil.BOOLEAN_TYPE).defaultValue(Boolean.TRUE.toString()));
9595
this.cliOptions.add(new CliOption(PREFIX_PARAMETER_INTERFACES, "Setting this property to true will generate parameter interface declarations prefixed with API class name to avoid name conflicts.", SchemaTypeUtil.BOOLEAN_TYPE).defaultValue(Boolean.FALSE.toString()));
96-
this.cliOptions.add(new CliOption(TYPESCRIPT_THREE_PLUS, "Setting this property to true will generate TypeScript 3.6+ compatible code.", SchemaTypeUtil.BOOLEAN_TYPE).defaultValue(Boolean.FALSE.toString()));
96+
this.cliOptions.add(new CliOption(TYPESCRIPT_THREE_PLUS, "Setting this property to true will generate TypeScript 3.6+ compatible code.", SchemaTypeUtil.BOOLEAN_TYPE).defaultValue(Boolean.TRUE.toString()));
9797
this.cliOptions.add(new CliOption(WITHOUT_RUNTIME_CHECKS, "Setting this property to true will remove any runtime checks on the request and response payloads. Payloads will be casted to their expected types.", SchemaTypeUtil.BOOLEAN_TYPE).defaultValue(Boolean.FALSE.toString()));
9898
this.cliOptions.add(new CliOption(SAGAS_AND_RECORDS, "Setting this property to true will generate additional files for use with redux-saga and immutablejs.", SchemaTypeUtil.BOOLEAN_TYPE).defaultValue(Boolean.FALSE.toString()));
9999
}

0 commit comments

Comments
 (0)