forked from loafle/openapi-generator-original
add withCredentials to the configuration (#5484)
* add withCredentials to the configuration 1. `withCredentials` in Request is `false` default 2. if want to set the `withCredentials` as `true` (for CORS request), instance `Configuration` object and set the `withCredentials` as `true`. * simplify the code according to the code review
This commit is contained in:
parent
e5fdf327db
commit
c7979da74d
@ -205,9 +205,8 @@ export class {{classname}} {
|
||||
body: formParams.toString(),
|
||||
{{/hasFormParams}}
|
||||
search: queryParameters,
|
||||
withCredentials:true
|
||||
withCredentials:this.configuration.withCredentials
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
|
@ -3,4 +3,5 @@ export class Configuration {
|
||||
username: string;
|
||||
password: string;
|
||||
accessToken: string | (() => string);
|
||||
withCredentials: boolean;
|
||||
}
|
@ -212,9 +212,8 @@ export class PetApi {
|
||||
headers: headers,
|
||||
body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612
|
||||
search: queryParameters,
|
||||
withCredentials:true
|
||||
withCredentials:this.configuration.withCredentials
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
@ -264,9 +263,8 @@ export class PetApi {
|
||||
method: RequestMethod.Delete,
|
||||
headers: headers,
|
||||
search: queryParameters,
|
||||
withCredentials:true
|
||||
withCredentials:this.configuration.withCredentials
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
@ -314,9 +312,8 @@ export class PetApi {
|
||||
method: RequestMethod.Get,
|
||||
headers: headers,
|
||||
search: queryParameters,
|
||||
withCredentials:true
|
||||
withCredentials:this.configuration.withCredentials
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
@ -364,9 +361,8 @@ export class PetApi {
|
||||
method: RequestMethod.Get,
|
||||
headers: headers,
|
||||
search: queryParameters,
|
||||
withCredentials:true
|
||||
withCredentials:this.configuration.withCredentials
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
@ -418,9 +414,8 @@ export class PetApi {
|
||||
method: RequestMethod.Get,
|
||||
headers: headers,
|
||||
search: queryParameters,
|
||||
withCredentials:true
|
||||
withCredentials:this.configuration.withCredentials
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
@ -467,9 +462,8 @@ export class PetApi {
|
||||
headers: headers,
|
||||
body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612
|
||||
search: queryParameters,
|
||||
withCredentials:true
|
||||
withCredentials:this.configuration.withCredentials
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
@ -532,9 +526,8 @@ export class PetApi {
|
||||
headers: headers,
|
||||
body: formParams.toString(),
|
||||
search: queryParameters,
|
||||
withCredentials:true
|
||||
withCredentials:this.configuration.withCredentials
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
@ -597,9 +590,8 @@ export class PetApi {
|
||||
headers: headers,
|
||||
body: formParams.toString(),
|
||||
search: queryParameters,
|
||||
withCredentials:true
|
||||
withCredentials:this.configuration.withCredentials
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
|
@ -133,9 +133,8 @@ export class StoreApi {
|
||||
method: RequestMethod.Delete,
|
||||
headers: headers,
|
||||
search: queryParameters,
|
||||
withCredentials:true
|
||||
withCredentials:this.configuration.withCredentials
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
@ -172,9 +171,8 @@ export class StoreApi {
|
||||
method: RequestMethod.Get,
|
||||
headers: headers,
|
||||
search: queryParameters,
|
||||
withCredentials:true
|
||||
withCredentials:this.configuration.withCredentials
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
@ -212,9 +210,8 @@ export class StoreApi {
|
||||
method: RequestMethod.Get,
|
||||
headers: headers,
|
||||
search: queryParameters,
|
||||
withCredentials:true
|
||||
withCredentials:this.configuration.withCredentials
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
@ -250,9 +247,8 @@ export class StoreApi {
|
||||
headers: headers,
|
||||
body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612
|
||||
search: queryParameters,
|
||||
withCredentials:true
|
||||
withCredentials:this.configuration.withCredentials
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
|
@ -197,9 +197,8 @@ export class UserApi {
|
||||
headers: headers,
|
||||
body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612
|
||||
search: queryParameters,
|
||||
withCredentials:true
|
||||
withCredentials:this.configuration.withCredentials
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
@ -235,9 +234,8 @@ export class UserApi {
|
||||
headers: headers,
|
||||
body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612
|
||||
search: queryParameters,
|
||||
withCredentials:true
|
||||
withCredentials:this.configuration.withCredentials
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
@ -273,9 +271,8 @@ export class UserApi {
|
||||
headers: headers,
|
||||
body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612
|
||||
search: queryParameters,
|
||||
withCredentials:true
|
||||
withCredentials:this.configuration.withCredentials
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
@ -313,9 +310,8 @@ export class UserApi {
|
||||
method: RequestMethod.Delete,
|
||||
headers: headers,
|
||||
search: queryParameters,
|
||||
withCredentials:true
|
||||
withCredentials:this.configuration.withCredentials
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
@ -353,9 +349,8 @@ export class UserApi {
|
||||
method: RequestMethod.Get,
|
||||
headers: headers,
|
||||
search: queryParameters,
|
||||
withCredentials:true
|
||||
withCredentials:this.configuration.withCredentials
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
@ -397,9 +392,8 @@ export class UserApi {
|
||||
method: RequestMethod.Get,
|
||||
headers: headers,
|
||||
search: queryParameters,
|
||||
withCredentials:true
|
||||
withCredentials:this.configuration.withCredentials
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
@ -431,9 +425,8 @@ export class UserApi {
|
||||
method: RequestMethod.Get,
|
||||
headers: headers,
|
||||
search: queryParameters,
|
||||
withCredentials:true
|
||||
withCredentials:this.configuration.withCredentials
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
@ -475,9 +468,8 @@ export class UserApi {
|
||||
headers: headers,
|
||||
body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612
|
||||
search: queryParameters,
|
||||
withCredentials:true
|
||||
withCredentials:this.configuration.withCredentials
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
|
@ -3,4 +3,5 @@ export class Configuration {
|
||||
username: string;
|
||||
password: string;
|
||||
accessToken: string | (() => string);
|
||||
withCredentials: boolean;
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
## @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201704132011
|
||||
## @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201704272137
|
||||
|
||||
### Building
|
||||
|
||||
@ -19,7 +19,7 @@ navigate to the folder of your consuming project and run one of next commando's.
|
||||
_published:_
|
||||
|
||||
```
|
||||
npm install @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201704132011 --save
|
||||
npm install @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201704272137 --save
|
||||
```
|
||||
|
||||
_unPublished (not recommended):_
|
||||
|
@ -212,9 +212,8 @@ export class PetApi {
|
||||
headers: headers,
|
||||
body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612
|
||||
search: queryParameters,
|
||||
withCredentials:true
|
||||
withCredentials:this.configuration.withCredentials
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
@ -264,9 +263,8 @@ export class PetApi {
|
||||
method: RequestMethod.Delete,
|
||||
headers: headers,
|
||||
search: queryParameters,
|
||||
withCredentials:true
|
||||
withCredentials:this.configuration.withCredentials
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
@ -314,9 +312,8 @@ export class PetApi {
|
||||
method: RequestMethod.Get,
|
||||
headers: headers,
|
||||
search: queryParameters,
|
||||
withCredentials:true
|
||||
withCredentials:this.configuration.withCredentials
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
@ -364,9 +361,8 @@ export class PetApi {
|
||||
method: RequestMethod.Get,
|
||||
headers: headers,
|
||||
search: queryParameters,
|
||||
withCredentials:true
|
||||
withCredentials:this.configuration.withCredentials
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
@ -418,9 +414,8 @@ export class PetApi {
|
||||
method: RequestMethod.Get,
|
||||
headers: headers,
|
||||
search: queryParameters,
|
||||
withCredentials:true
|
||||
withCredentials:this.configuration.withCredentials
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
@ -467,9 +462,8 @@ export class PetApi {
|
||||
headers: headers,
|
||||
body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612
|
||||
search: queryParameters,
|
||||
withCredentials:true
|
||||
withCredentials:this.configuration.withCredentials
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
@ -532,9 +526,8 @@ export class PetApi {
|
||||
headers: headers,
|
||||
body: formParams.toString(),
|
||||
search: queryParameters,
|
||||
withCredentials:true
|
||||
withCredentials:this.configuration.withCredentials
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
@ -597,9 +590,8 @@ export class PetApi {
|
||||
headers: headers,
|
||||
body: formParams.toString(),
|
||||
search: queryParameters,
|
||||
withCredentials:true
|
||||
withCredentials:this.configuration.withCredentials
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
|
@ -133,9 +133,8 @@ export class StoreApi {
|
||||
method: RequestMethod.Delete,
|
||||
headers: headers,
|
||||
search: queryParameters,
|
||||
withCredentials:true
|
||||
withCredentials:this.configuration.withCredentials
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
@ -172,9 +171,8 @@ export class StoreApi {
|
||||
method: RequestMethod.Get,
|
||||
headers: headers,
|
||||
search: queryParameters,
|
||||
withCredentials:true
|
||||
withCredentials:this.configuration.withCredentials
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
@ -212,9 +210,8 @@ export class StoreApi {
|
||||
method: RequestMethod.Get,
|
||||
headers: headers,
|
||||
search: queryParameters,
|
||||
withCredentials:true
|
||||
withCredentials:this.configuration.withCredentials
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
@ -250,9 +247,8 @@ export class StoreApi {
|
||||
headers: headers,
|
||||
body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612
|
||||
search: queryParameters,
|
||||
withCredentials:true
|
||||
withCredentials:this.configuration.withCredentials
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
|
@ -197,9 +197,8 @@ export class UserApi {
|
||||
headers: headers,
|
||||
body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612
|
||||
search: queryParameters,
|
||||
withCredentials:true
|
||||
withCredentials:this.configuration.withCredentials
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
@ -235,9 +234,8 @@ export class UserApi {
|
||||
headers: headers,
|
||||
body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612
|
||||
search: queryParameters,
|
||||
withCredentials:true
|
||||
withCredentials:this.configuration.withCredentials
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
@ -273,9 +271,8 @@ export class UserApi {
|
||||
headers: headers,
|
||||
body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612
|
||||
search: queryParameters,
|
||||
withCredentials:true
|
||||
withCredentials:this.configuration.withCredentials
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
@ -313,9 +310,8 @@ export class UserApi {
|
||||
method: RequestMethod.Delete,
|
||||
headers: headers,
|
||||
search: queryParameters,
|
||||
withCredentials:true
|
||||
withCredentials:this.configuration.withCredentials
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
@ -353,9 +349,8 @@ export class UserApi {
|
||||
method: RequestMethod.Get,
|
||||
headers: headers,
|
||||
search: queryParameters,
|
||||
withCredentials:true
|
||||
withCredentials:this.configuration.withCredentials
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
@ -397,9 +392,8 @@ export class UserApi {
|
||||
method: RequestMethod.Get,
|
||||
headers: headers,
|
||||
search: queryParameters,
|
||||
withCredentials:true
|
||||
withCredentials:this.configuration.withCredentials
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
@ -431,9 +425,8 @@ export class UserApi {
|
||||
method: RequestMethod.Get,
|
||||
headers: headers,
|
||||
search: queryParameters,
|
||||
withCredentials:true
|
||||
withCredentials:this.configuration.withCredentials
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
@ -475,9 +468,8 @@ export class UserApi {
|
||||
headers: headers,
|
||||
body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612
|
||||
search: queryParameters,
|
||||
withCredentials:true
|
||||
withCredentials:this.configuration.withCredentials
|
||||
});
|
||||
|
||||
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||
if (extraHttpRequestParams) {
|
||||
requestOptions = (<any>Object).assign(requestOptions, extraHttpRequestParams);
|
||||
|
@ -3,4 +3,5 @@ export class Configuration {
|
||||
username: string;
|
||||
password: string;
|
||||
accessToken: string | (() => string);
|
||||
withCredentials: boolean;
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@swagger/angular2-typescript-petstore",
|
||||
"version": "0.0.1-SNAPSHOT.201704132011",
|
||||
"version": "0.0.1-SNAPSHOT.201704272137",
|
||||
"description": "swagger client for @swagger/angular2-typescript-petstore",
|
||||
"author": "Swagger Codegen Contributors",
|
||||
"keywords": [
|
||||
|
Loading…
x
Reference in New Issue
Block a user