Skip to content

Commit 2ab70fa

Browse files
fix(typescript-axios): Ignore unused parameter on JSON serializer replacer function (#22858)
1 parent 9591118 commit 2ab70fa

16 files changed

Lines changed: 32 additions & 16 deletions

File tree

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ export const setSearchParams = function (url: URL, ...objects: any[]) {
110110
* This function will run for every key-value pair encountered by JSON.stringify while traversing an object.
111111
* Converting a set to a string will return an empty object, so an intermediate conversion to an array is required.
112112
*/
113-
export const replaceWithSerializableTypeIfNeeded = function(key: any, value: any) {
113+
// @ts-ignore
114+
export const replaceWithSerializableTypeIfNeeded = function(key: string, value: any) {
114115
if (value instanceof Set) {
115116
return Array.from(value);
116117
} else {

samples/client/echo_api/typescript-axios/build/common.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ export const setSearchParams = function (url: URL, ...objects: any[]) {
9696
* This function will run for every key-value pair encountered by JSON.stringify while traversing an object.
9797
* Converting a set to a string will return an empty object, so an intermediate conversion to an array is required.
9898
*/
99-
export const replaceWithSerializableTypeIfNeeded = function(key: any, value: any) {
99+
// @ts-ignore
100+
export const replaceWithSerializableTypeIfNeeded = function(key: string, value: any) {
100101
if (value instanceof Set) {
101102
return Array.from(value);
102103
} else {

samples/client/others/typescript-axios/with-separate-models-and-api-inheritance/common.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ export const setSearchParams = function (url: URL, ...objects: any[]) {
9696
* This function will run for every key-value pair encountered by JSON.stringify while traversing an object.
9797
* Converting a set to a string will return an empty object, so an intermediate conversion to an array is required.
9898
*/
99-
export const replaceWithSerializableTypeIfNeeded = function(key: any, value: any) {
99+
// @ts-ignore
100+
export const replaceWithSerializableTypeIfNeeded = function(key: string, value: any) {
100101
if (value instanceof Set) {
101102
return Array.from(value);
102103
} else {

samples/client/petstore/typescript-axios/builds/composed-schemas/common.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ export const setSearchParams = function (url: URL, ...objects: any[]) {
9696
* This function will run for every key-value pair encountered by JSON.stringify while traversing an object.
9797
* Converting a set to a string will return an empty object, so an intermediate conversion to an array is required.
9898
*/
99-
export const replaceWithSerializableTypeIfNeeded = function(key: any, value: any) {
99+
// @ts-ignore
100+
export const replaceWithSerializableTypeIfNeeded = function(key: string, value: any) {
100101
if (value instanceof Set) {
101102
return Array.from(value);
102103
} else {

samples/client/petstore/typescript-axios/builds/default/common.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ export const setSearchParams = function (url: URL, ...objects: any[]) {
9696
* This function will run for every key-value pair encountered by JSON.stringify while traversing an object.
9797
* Converting a set to a string will return an empty object, so an intermediate conversion to an array is required.
9898
*/
99-
export const replaceWithSerializableTypeIfNeeded = function(key: any, value: any) {
99+
// @ts-ignore
100+
export const replaceWithSerializableTypeIfNeeded = function(key: string, value: any) {
100101
if (value instanceof Set) {
101102
return Array.from(value);
102103
} else {

samples/client/petstore/typescript-axios/builds/es6-target/common.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ export const setSearchParams = function (url: URL, ...objects: any[]) {
9696
* This function will run for every key-value pair encountered by JSON.stringify while traversing an object.
9797
* Converting a set to a string will return an empty object, so an intermediate conversion to an array is required.
9898
*/
99-
export const replaceWithSerializableTypeIfNeeded = function(key: any, value: any) {
99+
// @ts-ignore
100+
export const replaceWithSerializableTypeIfNeeded = function(key: string, value: any) {
100101
if (value instanceof Set) {
101102
return Array.from(value);
102103
} else {

samples/client/petstore/typescript-axios/builds/test-petstore/common.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ export const setSearchParams = function (url: URL, ...objects: any[]) {
9696
* This function will run for every key-value pair encountered by JSON.stringify while traversing an object.
9797
* Converting a set to a string will return an empty object, so an intermediate conversion to an array is required.
9898
*/
99-
export const replaceWithSerializableTypeIfNeeded = function(key: any, value: any) {
99+
// @ts-ignore
100+
export const replaceWithSerializableTypeIfNeeded = function(key: string, value: any) {
100101
if (value instanceof Set) {
101102
return Array.from(value);
102103
} else {

samples/client/petstore/typescript-axios/builds/with-complex-headers/common.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ export const setSearchParams = function (url: URL, ...objects: any[]) {
9696
* This function will run for every key-value pair encountered by JSON.stringify while traversing an object.
9797
* Converting a set to a string will return an empty object, so an intermediate conversion to an array is required.
9898
*/
99-
export const replaceWithSerializableTypeIfNeeded = function(key: any, value: any) {
99+
// @ts-ignore
100+
export const replaceWithSerializableTypeIfNeeded = function(key: string, value: any) {
100101
if (value instanceof Set) {
101102
return Array.from(value);
102103
} else {

samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/common.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ export const setSearchParams = function (url: URL, ...objects: any[]) {
9696
* This function will run for every key-value pair encountered by JSON.stringify while traversing an object.
9797
* Converting a set to a string will return an empty object, so an intermediate conversion to an array is required.
9898
*/
99-
export const replaceWithSerializableTypeIfNeeded = function(key: any, value: any) {
99+
// @ts-ignore
100+
export const replaceWithSerializableTypeIfNeeded = function(key: string, value: any) {
100101
if (value instanceof Set) {
101102
return Array.from(value);
102103
} else {

samples/client/petstore/typescript-axios/builds/with-interfaces-and-with-single-request-param/common.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ export const setSearchParams = function (url: URL, ...objects: any[]) {
9696
* This function will run for every key-value pair encountered by JSON.stringify while traversing an object.
9797
* Converting a set to a string will return an empty object, so an intermediate conversion to an array is required.
9898
*/
99-
export const replaceWithSerializableTypeIfNeeded = function(key: any, value: any) {
99+
// @ts-ignore
100+
export const replaceWithSerializableTypeIfNeeded = function(key: string, value: any) {
100101
if (value instanceof Set) {
101102
return Array.from(value);
102103
} else {

0 commit comments

Comments
 (0)