File tree Expand file tree Collapse file tree 6 files changed +84
-6
lines changed
modules/openapi-generator/src/main/resources/typescript-fetch
samples/client/petstore/typescript-fetch/builds Expand file tree Collapse file tree 6 files changed +84
-6
lines changed Original file line number Diff line number Diff line change @@ -52,10 +52,13 @@ export class BaseAPI {
52
52
const body = (context.body instanceof FormData || isBlob(context.body))
53
53
? context.body
54
54
: JSON.stringify(context.body);
55
+
56
+ const headers = Object.assign({ } , this.configuration.headers, context.headers);
55
57
const init = {
56
58
method: context.method,
57
- headers: context. headers,
59
+ headers: headers,
58
60
body,
61
+ credentials: this.configuration.credentials
59
62
} ;
60
63
return { url, init } ;
61
64
}
@@ -121,6 +124,8 @@ export interface ConfigurationParameters {
121
124
password?: string; // parameter for basic security
122
125
apiKey?: string | ((name: string) => string); // parameter for apiKey security
123
126
accessToken?: string | ((name?: string, scopes?: string[]) => string); // parameter for oauth2 security
127
+ headers?: HTTPHeaders; //header params we want to use on every request
128
+ credentials?: RequestCredentials; //value for the credentials param we want to use on each request
124
129
}
125
130
126
131
export class Configuration {
@@ -165,6 +170,14 @@ export class Configuration {
165
170
}
166
171
return undefined;
167
172
}
173
+
174
+ get headers(): HTTPHeaders {
175
+ return this.configuration.headers;
176
+ }
177
+
178
+ get credentials(): RequestCredentials {
179
+ return this.configuration.credentials;
180
+ }
168
181
}
169
182
170
183
export type Json = any;
Original file line number Diff line number Diff line change @@ -63,10 +63,13 @@ export class BaseAPI {
63
63
const body = ( context . body instanceof FormData || isBlob ( context . body ) )
64
64
? context . body
65
65
: JSON . stringify ( context . body ) ;
66
+
67
+ const headers = Object . assign ( { } , this . configuration . headers , context . headers ) ;
66
68
const init = {
67
69
method : context . method ,
68
- headers : context . headers ,
70
+ headers : headers ,
69
71
body,
72
+ credentials : this . configuration . credentials
70
73
} ;
71
74
return { url, init } ;
72
75
}
@@ -132,6 +135,8 @@ export interface ConfigurationParameters {
132
135
password ?: string ; // parameter for basic security
133
136
apiKey ?: string | ( ( name : string ) => string ) ; // parameter for apiKey security
134
137
accessToken ?: string | ( ( name ?: string , scopes ?: string [ ] ) => string ) ; // parameter for oauth2 security
138
+ headers ?: HTTPHeaders ; //header params we want to use on every request
139
+ credentials ?: RequestCredentials ; //value for the credentials param we want to use on each request
135
140
}
136
141
137
142
export class Configuration {
@@ -176,6 +181,14 @@ export class Configuration {
176
181
}
177
182
return undefined ;
178
183
}
184
+
185
+ get headers ( ) : HTTPHeaders {
186
+ return this . configuration . headers ;
187
+ }
188
+
189
+ get credentials ( ) : RequestCredentials {
190
+ return this . configuration . credentials ;
191
+ }
179
192
}
180
193
181
194
export type Json = any ;
Original file line number Diff line number Diff line change @@ -63,10 +63,13 @@ export class BaseAPI {
63
63
const body = ( context . body instanceof FormData || isBlob ( context . body ) )
64
64
? context . body
65
65
: JSON . stringify ( context . body ) ;
66
+
67
+ const headers = Object . assign ( { } , this . configuration . headers , context . headers ) ;
66
68
const init = {
67
69
method : context . method ,
68
- headers : context . headers ,
70
+ headers : headers ,
69
71
body,
72
+ credentials : this . configuration . credentials
70
73
} ;
71
74
return { url, init } ;
72
75
}
@@ -132,6 +135,8 @@ export interface ConfigurationParameters {
132
135
password ?: string ; // parameter for basic security
133
136
apiKey ?: string | ( ( name : string ) => string ) ; // parameter for apiKey security
134
137
accessToken ?: string | ( ( name ?: string , scopes ?: string [ ] ) => string ) ; // parameter for oauth2 security
138
+ headers ?: HTTPHeaders ; //header params we want to use on every request
139
+ credentials ?: RequestCredentials ; //value for the credentials param we want to use on each request
135
140
}
136
141
137
142
export class Configuration {
@@ -176,6 +181,14 @@ export class Configuration {
176
181
}
177
182
return undefined ;
178
183
}
184
+
185
+ get headers ( ) : HTTPHeaders {
186
+ return this . configuration . headers ;
187
+ }
188
+
189
+ get credentials ( ) : RequestCredentials {
190
+ return this . configuration . credentials ;
191
+ }
179
192
}
180
193
181
194
export type Json = any ;
Original file line number Diff line number Diff line change @@ -63,10 +63,13 @@ export class BaseAPI {
63
63
const body = ( context . body instanceof FormData || isBlob ( context . body ) )
64
64
? context . body
65
65
: JSON . stringify ( context . body ) ;
66
+
67
+ const headers = Object . assign ( { } , this . configuration . headers , context . headers ) ;
66
68
const init = {
67
69
method : context . method ,
68
- headers : context . headers ,
70
+ headers : headers ,
69
71
body,
72
+ credentials : this . configuration . credentials
70
73
} ;
71
74
return { url, init } ;
72
75
}
@@ -132,6 +135,8 @@ export interface ConfigurationParameters {
132
135
password ?: string ; // parameter for basic security
133
136
apiKey ?: string | ( ( name : string ) => string ) ; // parameter for apiKey security
134
137
accessToken ?: string | ( ( name ?: string , scopes ?: string [ ] ) => string ) ; // parameter for oauth2 security
138
+ headers ?: HTTPHeaders ; //header params we want to use on every request
139
+ credentials ?: RequestCredentials ; //value for the credentials param we want to use on each request
135
140
}
136
141
137
142
export class Configuration {
@@ -176,6 +181,14 @@ export class Configuration {
176
181
}
177
182
return undefined ;
178
183
}
184
+
185
+ get headers ( ) : HTTPHeaders {
186
+ return this . configuration . headers ;
187
+ }
188
+
189
+ get credentials ( ) : RequestCredentials {
190
+ return this . configuration . credentials ;
191
+ }
179
192
}
180
193
181
194
export type Json = any ;
Original file line number Diff line number Diff line change @@ -63,10 +63,13 @@ export class BaseAPI {
63
63
const body = ( context . body instanceof FormData || isBlob ( context . body ) )
64
64
? context . body
65
65
: JSON . stringify ( context . body ) ;
66
+
67
+ const headers = Object . assign ( { } , this . configuration . headers , context . headers ) ;
66
68
const init = {
67
69
method : context . method ,
68
- headers : context . headers ,
70
+ headers : headers ,
69
71
body,
72
+ credentials : this . configuration . credentials
70
73
} ;
71
74
return { url, init } ;
72
75
}
@@ -132,6 +135,8 @@ export interface ConfigurationParameters {
132
135
password ?: string ; // parameter for basic security
133
136
apiKey ?: string | ( ( name : string ) => string ) ; // parameter for apiKey security
134
137
accessToken ?: string | ( ( name ?: string , scopes ?: string [ ] ) => string ) ; // parameter for oauth2 security
138
+ headers ?: HTTPHeaders ; //header params we want to use on every request
139
+ credentials ?: RequestCredentials ; //value for the credentials param we want to use on each request
135
140
}
136
141
137
142
export class Configuration {
@@ -176,6 +181,14 @@ export class Configuration {
176
181
}
177
182
return undefined ;
178
183
}
184
+
185
+ get headers ( ) : HTTPHeaders {
186
+ return this . configuration . headers ;
187
+ }
188
+
189
+ get credentials ( ) : RequestCredentials {
190
+ return this . configuration . credentials ;
191
+ }
179
192
}
180
193
181
194
export type Json = any ;
Original file line number Diff line number Diff line change @@ -63,10 +63,13 @@ export class BaseAPI {
63
63
const body = ( context . body instanceof FormData || isBlob ( context . body ) )
64
64
? context . body
65
65
: JSON . stringify ( context . body ) ;
66
+
67
+ const headers = Object . assign ( { } , this . configuration . headers , context . headers ) ;
66
68
const init = {
67
69
method : context . method ,
68
- headers : context . headers ,
70
+ headers : headers ,
69
71
body,
72
+ credentials : this . configuration . credentials
70
73
} ;
71
74
return { url, init } ;
72
75
}
@@ -132,6 +135,8 @@ export interface ConfigurationParameters {
132
135
password ?: string ; // parameter for basic security
133
136
apiKey ?: string | ( ( name : string ) => string ) ; // parameter for apiKey security
134
137
accessToken ?: string | ( ( name ?: string , scopes ?: string [ ] ) => string ) ; // parameter for oauth2 security
138
+ headers ?: HTTPHeaders ; //header params we want to use on every request
139
+ credentials ?: RequestCredentials ; //value for the credentials param we want to use on each request
135
140
}
136
141
137
142
export class Configuration {
@@ -176,6 +181,14 @@ export class Configuration {
176
181
}
177
182
return undefined ;
178
183
}
184
+
185
+ get headers ( ) : HTTPHeaders {
186
+ return this . configuration . headers ;
187
+ }
188
+
189
+ get credentials ( ) : RequestCredentials {
190
+ return this . configuration . credentials ;
191
+ }
179
192
}
180
193
181
194
export type Json = any ;
You can’t perform that action at this time.
0 commit comments