Skip to content

Commit 211ed96

Browse files
committed
test(openapi-ts-tests): update axios snapshots for TS2578 fix
1 parent 3c19d94 commit 211ed96

23 files changed

Lines changed: 92 additions & 69 deletions

File tree

packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/angular-query-experimental/axios/client/client.gen.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ export const createClient = (config: Config = {}): Client => {
3535
return getConfig();
3636
};
3737

38-
const beforeRequest = async (options: RequestOptions) => {
38+
const beforeRequest = async <TData = unknown, Url extends string = string>(
39+
options: RequestOptions<TData, boolean, Url>,
40+
) => {
3941
const opts = {
4042
..._config,
4143
...options,
@@ -58,14 +60,13 @@ export const createClient = (config: Config = {}): Client => {
5860
opts.body = opts.bodySerializer(opts.body);
5961
}
6062

61-
const url = buildUrl(opts);
63+
const url = buildUrl(opts as RequestOptions<unknown, boolean, string>);
6264

6365
return { opts, url };
6466
};
6567

6668
// @ts-expect-error
6769
const request: Client['request'] = async (options) => {
68-
// @ts-expect-error
6970
const { opts, url } = await beforeRequest(options);
7071
try {
7172
// assign Axios here for consistency with fetch

packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/preact-query/axios/client/client.gen.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ export const createClient = (config: Config = {}): Client => {
3535
return getConfig();
3636
};
3737

38-
const beforeRequest = async (options: RequestOptions) => {
38+
const beforeRequest = async <TData = unknown, Url extends string = string>(
39+
options: RequestOptions<TData, boolean, Url>,
40+
) => {
3941
const opts = {
4042
..._config,
4143
...options,
@@ -58,14 +60,13 @@ export const createClient = (config: Config = {}): Client => {
5860
opts.body = opts.bodySerializer(opts.body);
5961
}
6062

61-
const url = buildUrl(opts);
63+
const url = buildUrl(opts as RequestOptions<unknown, boolean, string>);
6264

6365
return { opts, url };
6466
};
6567

6668
// @ts-expect-error
6769
const request: Client['request'] = async (options) => {
68-
// @ts-expect-error
6970
const { opts, url } = await beforeRequest(options);
7071
try {
7172
// assign Axios here for consistency with fetch

packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/react-query/axios/client/client.gen.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ export const createClient = (config: Config = {}): Client => {
3535
return getConfig();
3636
};
3737

38-
const beforeRequest = async (options: RequestOptions) => {
38+
const beforeRequest = async <TData = unknown, Url extends string = string>(
39+
options: RequestOptions<TData, boolean, Url>,
40+
) => {
3941
const opts = {
4042
..._config,
4143
...options,
@@ -58,14 +60,13 @@ export const createClient = (config: Config = {}): Client => {
5860
opts.body = opts.bodySerializer(opts.body);
5961
}
6062

61-
const url = buildUrl(opts);
63+
const url = buildUrl(opts as RequestOptions<unknown, boolean, string>);
6264

6365
return { opts, url };
6466
};
6567

6668
// @ts-expect-error
6769
const request: Client['request'] = async (options) => {
68-
// @ts-expect-error
6970
const { opts, url } = await beforeRequest(options);
7071
try {
7172
// assign Axios here for consistency with fetch

packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/solid-query/axios/client/client.gen.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ export const createClient = (config: Config = {}): Client => {
3535
return getConfig();
3636
};
3737

38-
const beforeRequest = async (options: RequestOptions) => {
38+
const beforeRequest = async <TData = unknown, Url extends string = string>(
39+
options: RequestOptions<TData, boolean, Url>,
40+
) => {
3941
const opts = {
4042
..._config,
4143
...options,
@@ -58,14 +60,13 @@ export const createClient = (config: Config = {}): Client => {
5860
opts.body = opts.bodySerializer(opts.body);
5961
}
6062

61-
const url = buildUrl(opts);
63+
const url = buildUrl(opts as RequestOptions<unknown, boolean, string>);
6264

6365
return { opts, url };
6466
};
6567

6668
// @ts-expect-error
6769
const request: Client['request'] = async (options) => {
68-
// @ts-expect-error
6970
const { opts, url } = await beforeRequest(options);
7071
try {
7172
// assign Axios here for consistency with fetch

packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/svelte-query/axios/client/client.gen.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ export const createClient = (config: Config = {}): Client => {
3535
return getConfig();
3636
};
3737

38-
const beforeRequest = async (options: RequestOptions) => {
38+
const beforeRequest = async <TData = unknown, Url extends string = string>(
39+
options: RequestOptions<TData, boolean, Url>,
40+
) => {
3941
const opts = {
4042
..._config,
4143
...options,
@@ -58,14 +60,13 @@ export const createClient = (config: Config = {}): Client => {
5860
opts.body = opts.bodySerializer(opts.body);
5961
}
6062

61-
const url = buildUrl(opts);
63+
const url = buildUrl(opts as RequestOptions<unknown, boolean, string>);
6264

6365
return { opts, url };
6466
};
6567

6668
// @ts-expect-error
6769
const request: Client['request'] = async (options) => {
68-
// @ts-expect-error
6970
const { opts, url } = await beforeRequest(options);
7071
try {
7172
// assign Axios here for consistency with fetch

packages/openapi-ts-tests/main/test/__snapshots__/2.0.x/plugins/@tanstack/vue-query/axios/client/client.gen.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ export const createClient = (config: Config = {}): Client => {
3535
return getConfig();
3636
};
3737

38-
const beforeRequest = async (options: RequestOptions) => {
38+
const beforeRequest = async <TData = unknown, Url extends string = string>(
39+
options: RequestOptions<TData, boolean, Url>,
40+
) => {
3941
const opts = {
4042
..._config,
4143
...options,
@@ -58,14 +60,13 @@ export const createClient = (config: Config = {}): Client => {
5860
opts.body = opts.bodySerializer(opts.body);
5961
}
6062

61-
const url = buildUrl(opts);
63+
const url = buildUrl(opts as RequestOptions<unknown, boolean, string>);
6264

6365
return { opts, url };
6466
};
6567

6668
// @ts-expect-error
6769
const request: Client['request'] = async (options) => {
68-
// @ts-expect-error
6970
const { opts, url } = await beforeRequest(options);
7071
try {
7172
// assign Axios here for consistency with fetch

packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/content-types/client/client.gen.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ export const createClient = (config: Config = {}): Client => {
3535
return getConfig();
3636
};
3737

38-
const beforeRequest = async (options: RequestOptions) => {
38+
const beforeRequest = async <TData = unknown, Url extends string = string>(
39+
options: RequestOptions<TData, boolean, Url>,
40+
) => {
3941
const opts = {
4042
..._config,
4143
...options,
@@ -58,14 +60,13 @@ export const createClient = (config: Config = {}): Client => {
5860
opts.body = opts.bodySerializer(opts.body);
5961
}
6062

61-
const url = buildUrl(opts);
63+
const url = buildUrl(opts as RequestOptions<unknown, boolean, string>);
6264

6365
return { opts, url };
6466
};
6567

6668
// @ts-expect-error
6769
const request: Client['request'] = async (options) => {
68-
// @ts-expect-error
6970
const { opts, url } = await beforeRequest(options);
7071
try {
7172
// assign Axios here for consistency with fetch

packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/parameter-explode-false-axios/client/client.gen.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ export const createClient = (config: Config = {}): Client => {
3535
return getConfig();
3636
};
3737

38-
const beforeRequest = async (options: RequestOptions) => {
38+
const beforeRequest = async <TData = unknown, Url extends string = string>(
39+
options: RequestOptions<TData, boolean, Url>,
40+
) => {
3941
const opts = {
4042
..._config,
4143
...options,
@@ -58,14 +60,13 @@ export const createClient = (config: Config = {}): Client => {
5860
opts.body = opts.bodySerializer(opts.body);
5961
}
6062

61-
const url = buildUrl(opts);
63+
const url = buildUrl(opts as RequestOptions<unknown, boolean, string>);
6264

6365
return { opts, url };
6466
};
6567

6668
// @ts-expect-error
6769
const request: Client['request'] = async (options) => {
68-
// @ts-expect-error
6970
const { opts, url } = await beforeRequest(options);
7071
try {
7172
// assign Axios here for consistency with fetch

packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/angular-query-experimental/axios/client/client.gen.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ export const createClient = (config: Config = {}): Client => {
3535
return getConfig();
3636
};
3737

38-
const beforeRequest = async (options: RequestOptions) => {
38+
const beforeRequest = async <TData = unknown, Url extends string = string>(
39+
options: RequestOptions<TData, boolean, Url>,
40+
) => {
3941
const opts = {
4042
..._config,
4143
...options,
@@ -58,14 +60,13 @@ export const createClient = (config: Config = {}): Client => {
5860
opts.body = opts.bodySerializer(opts.body);
5961
}
6062

61-
const url = buildUrl(opts);
63+
const url = buildUrl(opts as RequestOptions<unknown, boolean, string>);
6264

6365
return { opts, url };
6466
};
6567

6668
// @ts-expect-error
6769
const request: Client['request'] = async (options) => {
68-
// @ts-expect-error
6970
const { opts, url } = await beforeRequest(options);
7071
try {
7172
// assign Axios here for consistency with fetch

packages/openapi-ts-tests/main/test/__snapshots__/3.0.x/plugins/@tanstack/preact-query/axios/client/client.gen.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ export const createClient = (config: Config = {}): Client => {
3535
return getConfig();
3636
};
3737

38-
const beforeRequest = async (options: RequestOptions) => {
38+
const beforeRequest = async <TData = unknown, Url extends string = string>(
39+
options: RequestOptions<TData, boolean, Url>,
40+
) => {
3941
const opts = {
4042
..._config,
4143
...options,
@@ -58,14 +60,13 @@ export const createClient = (config: Config = {}): Client => {
5860
opts.body = opts.bodySerializer(opts.body);
5961
}
6062

61-
const url = buildUrl(opts);
63+
const url = buildUrl(opts as RequestOptions<unknown, boolean, string>);
6264

6365
return { opts, url };
6466
};
6567

6668
// @ts-expect-error
6769
const request: Client['request'] = async (options) => {
68-
// @ts-expect-error
6970
const { opts, url } = await beforeRequest(options);
7071
try {
7172
// assign Axios here for consistency with fetch

0 commit comments

Comments
 (0)