@@ -67,7 +67,6 @@ type Config = {
67
67
TOKEN?: string | Resolver<string>;
68
68
USERNAME?: string | Resolver<string>;
69
69
PASSWORD?: string | Resolver<string>;
70
- DOMAIN?: string | Resolver<string>;
71
70
HEADERS?: Headers | Resolver<Headers>;
72
71
}
73
72
@@ -78,7 +77,6 @@ export const OpenAPI: Config = {
78
77
TOKEN: undefined,
79
78
USERNAME: undefined,
80
79
PASSWORD: undefined,
81
- DOMAIN: undefined,
82
80
HEADERS: undefined,
83
81
};"
84
82
`;
@@ -210,6 +208,9 @@ async function sendRequest(options: ApiRequestOptions, url: string): Promise<Res
210
208
headers: await getHeaders(options),
211
209
body: getRequestBody(options),
212
210
};
211
+ if (OpenAPI.WITH_CREDENTIALS) {
212
+ request.credentials = 'include';
213
+ }
213
214
return await fetch(url, request);
214
215
}
215
216
@@ -265,7 +266,7 @@ function catchErrors(options: ApiRequestOptions, result: ApiResult): void {
265
266
/**
266
267
* Request using fetch client
267
268
* @param options The request options from the the service
268
- * @result ApiResult
269
+ * @returns ApiResult
269
270
* @throws ApiError
270
271
*/
271
272
export async function request(options: ApiRequestOptions): Promise<ApiResult> {
@@ -284,10 +285,7 @@ export async function request(options: ApiRequestOptions): Promise<ApiResult> {
284
285
285
286
catchErrors(options, result);
286
287
return result;
287
- }
288
-
289
-
290
- "
288
+ }"
291
289
`;
292
290
293
291
exports[`v2 should generate: ./test/generated/v2/index.ts 1`] = `
@@ -1733,7 +1731,7 @@ export class ComplexService {
1733
1731
/**
1734
1732
* @param parameterObject Parameter containing object
1735
1733
* @param parameterReference Parameter containing reference
1736
- * @result ModelWithString Successful response
1734
+ * @returns ModelWithString Successful response
1737
1735
* @throws ApiError
1738
1736
*/
1739
1737
public static async complexTypes(
@@ -1937,7 +1935,7 @@ import { OpenAPI } from '../core/OpenAPI';
1937
1935
export class HeaderService {
1938
1936
1939
1937
/**
1940
- * @result string Successful response
1938
+ * @returns string Successful response
1941
1939
* @throws ApiError
1942
1940
*/
1943
1941
public static async callWithResultFromHeader(): Promise<string> {
@@ -2049,7 +2047,7 @@ import { OpenAPI } from '../core/OpenAPI';
2049
2047
export class ResponseService {
2050
2048
2051
2049
/**
2052
- * @result ModelWithString Message for default response
2050
+ * @returns ModelWithString Message for default response
2053
2051
* @throws ApiError
2054
2052
*/
2055
2053
public static async callWithResponse(): Promise<ModelWithString> {
@@ -2061,7 +2059,7 @@ export class ResponseService {
2061
2059
}
2062
2060
2063
2061
/**
2064
- * @result ModelWithString Message for default response
2062
+ * @returns ModelWithString Message for default response
2065
2063
* @throws ApiError
2066
2064
*/
2067
2065
public static async callWithDuplicateResponses(): Promise<ModelWithString> {
@@ -2078,10 +2076,10 @@ export class ResponseService {
2078
2076
}
2079
2077
2080
2078
/**
2081
- * @result any Message for 200 response
2082
- * @result ModelWithString Message for default response
2083
- * @result ModelThatExtends Message for 201 response
2084
- * @result ModelThatExtendsExtends Message for 202 response
2079
+ * @returns any Message for 200 response
2080
+ * @returns ModelWithString Message for default response
2081
+ * @returns ModelThatExtends Message for 201 response
2082
+ * @returns ModelThatExtendsExtends Message for 202 response
2085
2083
* @throws ApiError
2086
2084
*/
2087
2085
public static async callWithResponses(): Promise<{
@@ -2211,10 +2209,10 @@ export class TypesService {
2211
2209
* @param parameterBoolean This is a boolean parameter
2212
2210
* @param parameterObject This is an object parameter
2213
2211
* @param id This is a number parameter
2214
- * @result number Response is a simple number
2215
- * @result string Response is a simple string
2216
- * @result boolean Response is a simple boolean
2217
- * @result any Response is a simple object
2212
+ * @returns number Response is a simple number
2213
+ * @returns string Response is a simple string
2214
+ * @returns boolean Response is a simple boolean
2215
+ * @returns any Response is a simple object
2218
2216
* @throws ApiError
2219
2217
*/
2220
2218
public static async types(
@@ -2313,7 +2311,6 @@ type Config = {
2313
2311
TOKEN?: string | Resolver<string>;
2314
2312
USERNAME?: string | Resolver<string>;
2315
2313
PASSWORD?: string | Resolver<string>;
2316
- DOMAIN?: string | Resolver<string>;
2317
2314
HEADERS?: Headers | Resolver<Headers>;
2318
2315
}
2319
2316
@@ -2324,7 +2321,6 @@ export const OpenAPI: Config = {
2324
2321
TOKEN: undefined,
2325
2322
USERNAME: undefined,
2326
2323
PASSWORD: undefined,
2327
- DOMAIN: undefined,
2328
2324
HEADERS: undefined,
2329
2325
};"
2330
2326
`;
@@ -2456,6 +2452,9 @@ async function sendRequest(options: ApiRequestOptions, url: string): Promise<Res
2456
2452
headers: await getHeaders(options),
2457
2453
body: getRequestBody(options),
2458
2454
};
2455
+ if (OpenAPI.WITH_CREDENTIALS) {
2456
+ request.credentials = 'include';
2457
+ }
2459
2458
return await fetch(url, request);
2460
2459
}
2461
2460
@@ -2511,7 +2510,7 @@ function catchErrors(options: ApiRequestOptions, result: ApiResult): void {
2511
2510
/**
2512
2511
* Request using fetch client
2513
2512
* @param options The request options from the the service
2514
- * @result ApiResult
2513
+ * @returns ApiResult
2515
2514
* @throws ApiError
2516
2515
*/
2517
2516
export async function request(options: ApiRequestOptions): Promise<ApiResult> {
@@ -2530,10 +2529,7 @@ export async function request(options: ApiRequestOptions): Promise<ApiResult> {
2530
2529
2531
2530
catchErrors(options, result);
2532
2531
return result;
2533
- }
2534
-
2535
-
2536
- "
2532
+ }"
2537
2533
`;
2538
2534
2539
2535
exports[`v3 should generate: ./test/generated/v3/index.ts 1`] = `
@@ -4250,7 +4246,7 @@ export class ComplexService {
4250
4246
/**
4251
4247
* @param parameterObject Parameter containing object
4252
4248
* @param parameterReference Parameter containing reference
4253
- * @result ModelWithString Successful response
4249
+ * @returns ModelWithString Successful response
4254
4250
* @throws ApiError
4255
4251
*/
4256
4252
public static async complexTypes(
@@ -4281,7 +4277,7 @@ export class ComplexService {
4281
4277
/**
4282
4278
* @param id
4283
4279
* @param requestBody
4284
- * @result ModelWithString Success
4280
+ * @returns ModelWithString Success
4285
4281
* @throws ApiError
4286
4282
*/
4287
4283
public static async complexParams(
@@ -4484,7 +4480,7 @@ import { OpenAPI } from '../core/OpenAPI';
4484
4480
export class HeaderService {
4485
4481
4486
4482
/**
4487
- * @result string Successful response
4483
+ * @returns string Successful response
4488
4484
* @throws ApiError
4489
4485
*/
4490
4486
public static async callWithResultFromHeader(): Promise<string> {
@@ -4513,7 +4509,7 @@ import { OpenAPI } from '../core/OpenAPI';
4513
4509
export class MultipartService {
4514
4510
4515
4511
/**
4516
- * @result any OK
4512
+ * @returns any OK
4517
4513
* @throws ApiError
4518
4514
*/
4519
4515
public static async multipartResponse(): Promise<{
@@ -4705,7 +4701,7 @@ import { OpenAPI } from '../core/OpenAPI';
4705
4701
export class ResponseService {
4706
4702
4707
4703
/**
4708
- * @result ModelWithString
4704
+ * @returns ModelWithString
4709
4705
* @throws ApiError
4710
4706
*/
4711
4707
public static async callWithResponse(): Promise<ModelWithString> {
@@ -4717,7 +4713,7 @@ export class ResponseService {
4717
4713
}
4718
4714
4719
4715
/**
4720
- * @result ModelWithString Message for default response
4716
+ * @returns ModelWithString Message for default response
4721
4717
* @throws ApiError
4722
4718
*/
4723
4719
public static async callWithDuplicateResponses(): Promise<ModelWithString> {
@@ -4734,10 +4730,10 @@ export class ResponseService {
4734
4730
}
4735
4731
4736
4732
/**
4737
- * @result any Message for 200 response
4738
- * @result ModelWithString Message for default response
4739
- * @result ModelThatExtends Message for 201 response
4740
- * @result ModelThatExtendsExtends Message for 202 response
4733
+ * @returns any Message for 200 response
4734
+ * @returns ModelWithString Message for default response
4735
+ * @returns ModelThatExtends Message for 201 response
4736
+ * @returns ModelThatExtendsExtends Message for 202 response
4741
4737
* @throws ApiError
4742
4738
*/
4743
4739
public static async callWithResponses(): Promise<{
@@ -4867,10 +4863,10 @@ export class TypesService {
4867
4863
* @param parameterString This is a string parameter
4868
4864
* @param parameterBoolean This is a boolean parameter
4869
4865
* @param id This is a number parameter
4870
- * @result number Response is a simple number
4871
- * @result string Response is a simple string
4872
- * @result boolean Response is a simple boolean
4873
- * @result any Response is a simple object
4866
+ * @returns number Response is a simple number
4867
+ * @returns string Response is a simple string
4868
+ * @returns boolean Response is a simple boolean
4869
+ * @returns any Response is a simple object
4874
4870
* @throws ApiError
4875
4871
*/
4876
4872
public static async types(
@@ -4913,7 +4909,7 @@ export class UploadService {
4913
4909
4914
4910
/**
4915
4911
* @param file Supply a file reference for upload
4916
- * @result boolean
4912
+ * @returns boolean
4917
4913
* @throws ApiError
4918
4914
*/
4919
4915
public static async uploadFile(
0 commit comments