Skip to content

Commit 8c49447

Browse files
fix: Update axios version, regenerate samples
1 parent 763c77e commit 8c49447

24 files changed

Lines changed: 1187 additions & 143 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public class TypeScriptAxiosClientCodegen extends AbstractTypeScriptClientCodege
5151
public static final String IMPORT_FILE_EXTENSION_SWITCH_DESC = "File extension to use with relative imports. Set it to '.js' or '.mjs' when using [ESM](https://nodejs.org/api/esm.html).";
5252
public static final String USE_SQUARE_BRACKETS_IN_ARRAY_NAMES = "useSquareBracketsInArrayNames";
5353
public static final String AXIOS_VERSION = "axiosVersion";
54-
public static final String DEFAULT_AXIOS_VERSION = "^1.6.1";
54+
public static final String DEFAULT_AXIOS_VERSION = "^1.12.2";
5555

5656
@Getter @Setter
5757
protected String npmRepository = null;

modules/openapi-generator/src/main/resources/typescript-axios/package.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"axios": "{{axiosVersion}}"
3030
},
3131
"devDependencies": {
32-
"@types/node": "12.11.5 - 12.20.42",
32+
"@types/node": "12.11.5 - 14.14.31",
3333
"typescript": "^4.0 || ^5.0"
3434
}{{#npmRepository}},{{/npmRepository}}
3535
{{#npmRepository}}

modules/openapi-generator/src/main/resources/typescript-axios/tsconfig.mustache

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
"declaration": true,
44
"target": "{{#supportsES6}}ES6{{/supportsES6}}{{^supportsES6}}ES5{{/supportsES6}}",
55
"module": "commonjs",
6+
"strictNullChecks": true,
7+
"exactOptionalPropertyTypes": true,
68
"noImplicitAny": true,
79
"outDir": "dist",
810
"rootDir": ".",

modules/openapi-generator/src/main/resources/typescript-fetch/tsconfig.mustache

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
"strict": true,
77
{{/sagasAndRecords}}
88
"module": "commonjs",
9+
"strictNullChecks": true,
10+
"exactOptionalPropertyTypes": true,
911
"moduleResolution": "node",
1012
"outDir": "dist",
1113
{{^supportsES6}}

samples/client/echo_api/typescript-axios/build/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
"prepare": "npm run build"
2323
},
2424
"dependencies": {
25-
"axios": "^1.6.1"
25+
"axios": "^1.12.2"
2626
},
2727
"devDependencies": {
28-
"@types/node": "12.11.5 - 12.20.42",
28+
"@types/node": "12.11.5 - 14.14.31",
2929
"typescript": "^4.0 || ^5.0"
3030
}
3131
}

samples/client/echo_api/typescript-axios/build/tsconfig.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
"declaration": true,
44
"target": "ES5",
55
"module": "commonjs",
6+
"strictNullChecks": true,
7+
"exactOptionalPropertyTypes": true,
68
"noImplicitAny": true,
79
"outDir": "dist",
810
"rootDir": ".",

samples/client/others/typescript-fetch/infinite-recursion-issue/models/TestBaseDto.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import {
2121
TestObjectTypeToJSONTyped,
2222
} from './TestObjectType';
2323

24-
import { type TestBaseDto, TestBaseDtoFromJSONTyped, TestBaseDtoToJSON, TestBaseDtoToJSONTyped } from './TestBaseDto';
2524
import { type ExtendDto, ExtendDtoFromJSONTyped, ExtendDtoToJSON, ExtendDtoToJSONTyped } from './ExtendDto';
2625
/**
2726
*
@@ -61,12 +60,12 @@ export function TestBaseDtoFromJSONTyped(json: any, ignoreDiscriminator: boolean
6160
return json;
6261
}
6362
if (!ignoreDiscriminator) {
64-
if (json['testObjectType'] === 'TEST1') {
65-
return TestBaseDtoFromJSONTyped(json, ignoreDiscriminator);
66-
}
6763
if (json['testObjectType'] === 'TEST2') {
6864
return ExtendDtoFromJSONTyped(json, ignoreDiscriminator);
6965
}
66+
if (json['testObjectType'] === 'TEST1') {
67+
return TestBaseDtoFromJSONTyped(json, true);
68+
}
7069

7170
}
7271
return {
@@ -87,8 +86,6 @@ export function TestBaseDtoToJSONTyped(value?: TestBaseDto | null, ignoreDiscrim
8786

8887
if (!ignoreDiscriminator) {
8988
switch (value['testObjectType']) {
90-
case 'TEST1':
91-
return TestBaseDtoToJSONTyped(value as TestBaseDto, ignoreDiscriminator);
9289
case 'TEST2':
9390
return ExtendDtoToJSONTyped(value as ExtendDto, ignoreDiscriminator);
9491
default:

samples/client/petstore/typescript-axios/builds/es6-target/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424
"prepare": "npm run build"
2525
},
2626
"dependencies": {
27-
"axios": "^1.6.1"
27+
"axios": "^1.12.2"
2828
},
2929
"devDependencies": {
30-
"@types/node": "12.11.5 - 12.20.42",
30+
"@types/node": "12.11.5 - 14.14.31",
3131
"typescript": "^4.0 || ^5.0"
3232
},
3333
"publishConfig": {

samples/client/petstore/typescript-axios/builds/es6-target/tsconfig.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
"declaration": true,
44
"target": "ES6",
55
"module": "commonjs",
6+
"strictNullChecks": true,
7+
"exactOptionalPropertyTypes": true,
68
"noImplicitAny": true,
79
"outDir": "dist",
810
"rootDir": ".",

0 commit comments

Comments
 (0)