forked from loafle/openapi-generator-original
Fix for missing headers (2.3.0) (#4329)
* Fix for #4322 Signed-off-by: Sebastian Haas <sebastian@haas.tech> * Run typescript-angular2-petstore-all.sh Signed-off-by: Sebastian Haas <sebastian@haas.tech>
This commit is contained in:
parent
4785451bf8
commit
1ee7907aaa
@ -102,10 +102,9 @@ export class {{classname}} {
|
|||||||
}
|
}
|
||||||
{{/queryParams}}
|
{{/queryParams}}
|
||||||
|
|
||||||
{{#headers}}
|
{{#headerParams}}
|
||||||
headers.set('{{baseName}}', String({{paramName}}));
|
headers.set('{{baseName}}', String({{paramName}}));
|
||||||
|
{{/headerParams}}
|
||||||
{{/headers}}
|
|
||||||
|
|
||||||
// to determine the Content-Type header
|
// to determine the Content-Type header
|
||||||
let consumes: string[] = [
|
let consumes: string[] = [
|
||||||
|
@ -54,6 +54,21 @@ export class PetService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Extends object by coping non-existing properties.
|
||||||
|
* @param objA object to be extended
|
||||||
|
* @param objB source object
|
||||||
|
*/
|
||||||
|
private extendObj<T1,T2>(objA: T1, objB: T2) {
|
||||||
|
for(let key in objB){
|
||||||
|
if(objB.hasOwnProperty(key)){
|
||||||
|
objA[key] = objB[key];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return <T1&T2>objA;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a new pet to the store
|
* Add a new pet to the store
|
||||||
*
|
*
|
||||||
@ -227,10 +242,14 @@ export class PetService {
|
|||||||
method: RequestMethod.Post,
|
method: RequestMethod.Post,
|
||||||
headers: headers,
|
headers: headers,
|
||||||
body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612
|
body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612
|
||||||
search: queryParameters,
|
search: queryParameters
|
||||||
responseType: ResponseContentType.Json
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||||
|
if (extraHttpRequestParams) {
|
||||||
|
requestOptions = this.extendObj(requestOptions, extraHttpRequestParams);
|
||||||
|
}
|
||||||
|
|
||||||
return this.http.request(path, requestOptions);
|
return this.http.request(path, requestOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -250,6 +269,7 @@ export class PetService {
|
|||||||
throw new Error('Required parameter petId was null or undefined when calling deletePet.');
|
throw new Error('Required parameter petId was null or undefined when calling deletePet.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
headers.set('api_key', String(apiKey));
|
||||||
|
|
||||||
// to determine the Content-Type header
|
// to determine the Content-Type header
|
||||||
let consumes: string[] = [
|
let consumes: string[] = [
|
||||||
@ -274,10 +294,14 @@ export class PetService {
|
|||||||
let requestOptions: RequestOptionsArgs = new RequestOptions({
|
let requestOptions: RequestOptionsArgs = new RequestOptions({
|
||||||
method: RequestMethod.Delete,
|
method: RequestMethod.Delete,
|
||||||
headers: headers,
|
headers: headers,
|
||||||
search: queryParameters,
|
search: queryParameters
|
||||||
responseType: ResponseContentType.Json
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||||
|
if (extraHttpRequestParams) {
|
||||||
|
requestOptions = this.extendObj(requestOptions, extraHttpRequestParams);
|
||||||
|
}
|
||||||
|
|
||||||
return this.http.request(path, requestOptions);
|
return this.http.request(path, requestOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -319,10 +343,14 @@ export class PetService {
|
|||||||
let requestOptions: RequestOptionsArgs = new RequestOptions({
|
let requestOptions: RequestOptionsArgs = new RequestOptions({
|
||||||
method: RequestMethod.Get,
|
method: RequestMethod.Get,
|
||||||
headers: headers,
|
headers: headers,
|
||||||
search: queryParameters,
|
search: queryParameters
|
||||||
responseType: ResponseContentType.Json
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||||
|
if (extraHttpRequestParams) {
|
||||||
|
requestOptions = this.extendObj(requestOptions, extraHttpRequestParams);
|
||||||
|
}
|
||||||
|
|
||||||
return this.http.request(path, requestOptions);
|
return this.http.request(path, requestOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -364,10 +392,14 @@ export class PetService {
|
|||||||
let requestOptions: RequestOptionsArgs = new RequestOptions({
|
let requestOptions: RequestOptionsArgs = new RequestOptions({
|
||||||
method: RequestMethod.Get,
|
method: RequestMethod.Get,
|
||||||
headers: headers,
|
headers: headers,
|
||||||
search: queryParameters,
|
search: queryParameters
|
||||||
responseType: ResponseContentType.Json
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||||
|
if (extraHttpRequestParams) {
|
||||||
|
requestOptions = this.extendObj(requestOptions, extraHttpRequestParams);
|
||||||
|
}
|
||||||
|
|
||||||
return this.http.request(path, requestOptions);
|
return this.http.request(path, requestOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -397,17 +429,17 @@ export class PetService {
|
|||||||
'application/xml'
|
'application/xml'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// authentication (api_key) required
|
||||||
|
if (this.configuration.apiKey)
|
||||||
|
{
|
||||||
|
headers.set('api_key', this.configuration.apiKey);
|
||||||
|
}
|
||||||
// authentication (petstore_auth) required
|
// authentication (petstore_auth) required
|
||||||
// oauth required
|
// oauth required
|
||||||
if (this.configuration.accessToken)
|
if (this.configuration.accessToken)
|
||||||
{
|
{
|
||||||
headers.set('Authorization', 'Bearer ' + this.configuration.accessToken);
|
headers.set('Authorization', 'Bearer ' + this.configuration.accessToken);
|
||||||
}
|
}
|
||||||
// authentication (api_key) required
|
|
||||||
if (this.configuration.apiKey)
|
|
||||||
{
|
|
||||||
headers.set('api_key', this.configuration.apiKey);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -415,10 +447,14 @@ export class PetService {
|
|||||||
let requestOptions: RequestOptionsArgs = new RequestOptions({
|
let requestOptions: RequestOptionsArgs = new RequestOptions({
|
||||||
method: RequestMethod.Get,
|
method: RequestMethod.Get,
|
||||||
headers: headers,
|
headers: headers,
|
||||||
search: queryParameters,
|
search: queryParameters
|
||||||
responseType: ResponseContentType.Json
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||||
|
if (extraHttpRequestParams) {
|
||||||
|
requestOptions = this.extendObj(requestOptions, extraHttpRequestParams);
|
||||||
|
}
|
||||||
|
|
||||||
return this.http.request(path, requestOptions);
|
return this.http.request(path, requestOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -461,10 +497,14 @@ export class PetService {
|
|||||||
method: RequestMethod.Put,
|
method: RequestMethod.Put,
|
||||||
headers: headers,
|
headers: headers,
|
||||||
body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612
|
body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612
|
||||||
search: queryParameters,
|
search: queryParameters
|
||||||
responseType: ResponseContentType.Json
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||||
|
if (extraHttpRequestParams) {
|
||||||
|
requestOptions = this.extendObj(requestOptions, extraHttpRequestParams);
|
||||||
|
}
|
||||||
|
|
||||||
return this.http.request(path, requestOptions);
|
return this.http.request(path, requestOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -520,10 +560,14 @@ export class PetService {
|
|||||||
method: RequestMethod.Post,
|
method: RequestMethod.Post,
|
||||||
headers: headers,
|
headers: headers,
|
||||||
body: formParams.toString(),
|
body: formParams.toString(),
|
||||||
search: queryParameters,
|
search: queryParameters
|
||||||
responseType: ResponseContentType.Json
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||||
|
if (extraHttpRequestParams) {
|
||||||
|
requestOptions = this.extendObj(requestOptions, extraHttpRequestParams);
|
||||||
|
}
|
||||||
|
|
||||||
return this.http.request(path, requestOptions);
|
return this.http.request(path, requestOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -579,10 +623,14 @@ export class PetService {
|
|||||||
method: RequestMethod.Post,
|
method: RequestMethod.Post,
|
||||||
headers: headers,
|
headers: headers,
|
||||||
body: formParams.toString(),
|
body: formParams.toString(),
|
||||||
search: queryParameters,
|
search: queryParameters
|
||||||
responseType: ResponseContentType.Json
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||||
|
if (extraHttpRequestParams) {
|
||||||
|
requestOptions = this.extendObj(requestOptions, extraHttpRequestParams);
|
||||||
|
}
|
||||||
|
|
||||||
return this.http.request(path, requestOptions);
|
return this.http.request(path, requestOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,6 +54,21 @@ export class StoreService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Extends object by coping non-existing properties.
|
||||||
|
* @param objA object to be extended
|
||||||
|
* @param objB source object
|
||||||
|
*/
|
||||||
|
private extendObj<T1,T2>(objA: T1, objB: T2) {
|
||||||
|
for(let key in objB){
|
||||||
|
if(objB.hasOwnProperty(key)){
|
||||||
|
objA[key] = objB[key];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return <T1&T2>objA;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete purchase order by ID
|
* Delete purchase order by ID
|
||||||
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||||
@ -151,10 +166,14 @@ export class StoreService {
|
|||||||
let requestOptions: RequestOptionsArgs = new RequestOptions({
|
let requestOptions: RequestOptionsArgs = new RequestOptions({
|
||||||
method: RequestMethod.Delete,
|
method: RequestMethod.Delete,
|
||||||
headers: headers,
|
headers: headers,
|
||||||
search: queryParameters,
|
search: queryParameters
|
||||||
responseType: ResponseContentType.Json
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||||
|
if (extraHttpRequestParams) {
|
||||||
|
requestOptions = this.extendObj(requestOptions, extraHttpRequestParams);
|
||||||
|
}
|
||||||
|
|
||||||
return this.http.request(path, requestOptions);
|
return this.http.request(path, requestOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -191,10 +210,14 @@ export class StoreService {
|
|||||||
let requestOptions: RequestOptionsArgs = new RequestOptions({
|
let requestOptions: RequestOptionsArgs = new RequestOptions({
|
||||||
method: RequestMethod.Get,
|
method: RequestMethod.Get,
|
||||||
headers: headers,
|
headers: headers,
|
||||||
search: queryParameters,
|
search: queryParameters
|
||||||
responseType: ResponseContentType.Json
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||||
|
if (extraHttpRequestParams) {
|
||||||
|
requestOptions = this.extendObj(requestOptions, extraHttpRequestParams);
|
||||||
|
}
|
||||||
|
|
||||||
return this.http.request(path, requestOptions);
|
return this.http.request(path, requestOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -231,10 +254,14 @@ export class StoreService {
|
|||||||
let requestOptions: RequestOptionsArgs = new RequestOptions({
|
let requestOptions: RequestOptionsArgs = new RequestOptions({
|
||||||
method: RequestMethod.Get,
|
method: RequestMethod.Get,
|
||||||
headers: headers,
|
headers: headers,
|
||||||
search: queryParameters,
|
search: queryParameters
|
||||||
responseType: ResponseContentType.Json
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||||
|
if (extraHttpRequestParams) {
|
||||||
|
requestOptions = this.extendObj(requestOptions, extraHttpRequestParams);
|
||||||
|
}
|
||||||
|
|
||||||
return this.http.request(path, requestOptions);
|
return this.http.request(path, requestOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -269,10 +296,14 @@ export class StoreService {
|
|||||||
method: RequestMethod.Post,
|
method: RequestMethod.Post,
|
||||||
headers: headers,
|
headers: headers,
|
||||||
body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612
|
body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612
|
||||||
search: queryParameters,
|
search: queryParameters
|
||||||
responseType: ResponseContentType.Json
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||||
|
if (extraHttpRequestParams) {
|
||||||
|
requestOptions = this.extendObj(requestOptions, extraHttpRequestParams);
|
||||||
|
}
|
||||||
|
|
||||||
return this.http.request(path, requestOptions);
|
return this.http.request(path, requestOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,6 +54,21 @@ export class UserService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Extends object by coping non-existing properties.
|
||||||
|
* @param objA object to be extended
|
||||||
|
* @param objB source object
|
||||||
|
*/
|
||||||
|
private extendObj<T1,T2>(objA: T1, objB: T2) {
|
||||||
|
for(let key in objB){
|
||||||
|
if(objB.hasOwnProperty(key)){
|
||||||
|
objA[key] = objB[key];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return <T1&T2>objA;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create user
|
* Create user
|
||||||
* This can only be done by the logged in user.
|
* This can only be done by the logged in user.
|
||||||
@ -215,10 +230,14 @@ export class UserService {
|
|||||||
method: RequestMethod.Post,
|
method: RequestMethod.Post,
|
||||||
headers: headers,
|
headers: headers,
|
||||||
body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612
|
body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612
|
||||||
search: queryParameters,
|
search: queryParameters
|
||||||
responseType: ResponseContentType.Json
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||||
|
if (extraHttpRequestParams) {
|
||||||
|
requestOptions = this.extendObj(requestOptions, extraHttpRequestParams);
|
||||||
|
}
|
||||||
|
|
||||||
return this.http.request(path, requestOptions);
|
return this.http.request(path, requestOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -253,10 +272,14 @@ export class UserService {
|
|||||||
method: RequestMethod.Post,
|
method: RequestMethod.Post,
|
||||||
headers: headers,
|
headers: headers,
|
||||||
body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612
|
body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612
|
||||||
search: queryParameters,
|
search: queryParameters
|
||||||
responseType: ResponseContentType.Json
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||||
|
if (extraHttpRequestParams) {
|
||||||
|
requestOptions = this.extendObj(requestOptions, extraHttpRequestParams);
|
||||||
|
}
|
||||||
|
|
||||||
return this.http.request(path, requestOptions);
|
return this.http.request(path, requestOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -291,10 +314,14 @@ export class UserService {
|
|||||||
method: RequestMethod.Post,
|
method: RequestMethod.Post,
|
||||||
headers: headers,
|
headers: headers,
|
||||||
body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612
|
body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612
|
||||||
search: queryParameters,
|
search: queryParameters
|
||||||
responseType: ResponseContentType.Json
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||||
|
if (extraHttpRequestParams) {
|
||||||
|
requestOptions = this.extendObj(requestOptions, extraHttpRequestParams);
|
||||||
|
}
|
||||||
|
|
||||||
return this.http.request(path, requestOptions);
|
return this.http.request(path, requestOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -331,10 +358,14 @@ export class UserService {
|
|||||||
let requestOptions: RequestOptionsArgs = new RequestOptions({
|
let requestOptions: RequestOptionsArgs = new RequestOptions({
|
||||||
method: RequestMethod.Delete,
|
method: RequestMethod.Delete,
|
||||||
headers: headers,
|
headers: headers,
|
||||||
search: queryParameters,
|
search: queryParameters
|
||||||
responseType: ResponseContentType.Json
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||||
|
if (extraHttpRequestParams) {
|
||||||
|
requestOptions = this.extendObj(requestOptions, extraHttpRequestParams);
|
||||||
|
}
|
||||||
|
|
||||||
return this.http.request(path, requestOptions);
|
return this.http.request(path, requestOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -371,10 +402,14 @@ export class UserService {
|
|||||||
let requestOptions: RequestOptionsArgs = new RequestOptions({
|
let requestOptions: RequestOptionsArgs = new RequestOptions({
|
||||||
method: RequestMethod.Get,
|
method: RequestMethod.Get,
|
||||||
headers: headers,
|
headers: headers,
|
||||||
search: queryParameters,
|
search: queryParameters
|
||||||
responseType: ResponseContentType.Json
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||||
|
if (extraHttpRequestParams) {
|
||||||
|
requestOptions = this.extendObj(requestOptions, extraHttpRequestParams);
|
||||||
|
}
|
||||||
|
|
||||||
return this.http.request(path, requestOptions);
|
return this.http.request(path, requestOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -414,10 +449,14 @@ export class UserService {
|
|||||||
let requestOptions: RequestOptionsArgs = new RequestOptions({
|
let requestOptions: RequestOptionsArgs = new RequestOptions({
|
||||||
method: RequestMethod.Get,
|
method: RequestMethod.Get,
|
||||||
headers: headers,
|
headers: headers,
|
||||||
search: queryParameters,
|
search: queryParameters
|
||||||
responseType: ResponseContentType.Json
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||||
|
if (extraHttpRequestParams) {
|
||||||
|
requestOptions = this.extendObj(requestOptions, extraHttpRequestParams);
|
||||||
|
}
|
||||||
|
|
||||||
return this.http.request(path, requestOptions);
|
return this.http.request(path, requestOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -449,10 +488,14 @@ export class UserService {
|
|||||||
let requestOptions: RequestOptionsArgs = new RequestOptions({
|
let requestOptions: RequestOptionsArgs = new RequestOptions({
|
||||||
method: RequestMethod.Get,
|
method: RequestMethod.Get,
|
||||||
headers: headers,
|
headers: headers,
|
||||||
search: queryParameters,
|
search: queryParameters
|
||||||
responseType: ResponseContentType.Json
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||||
|
if (extraHttpRequestParams) {
|
||||||
|
requestOptions = this.extendObj(requestOptions, extraHttpRequestParams);
|
||||||
|
}
|
||||||
|
|
||||||
return this.http.request(path, requestOptions);
|
return this.http.request(path, requestOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -492,10 +535,14 @@ export class UserService {
|
|||||||
method: RequestMethod.Put,
|
method: RequestMethod.Put,
|
||||||
headers: headers,
|
headers: headers,
|
||||||
body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612
|
body: body == null ? '' : JSON.stringify(body), // https://github.com/angular/angular/issues/10612
|
||||||
search: queryParameters,
|
search: queryParameters
|
||||||
responseType: ResponseContentType.Json
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// https://github.com/swagger-api/swagger-codegen/issues/4037
|
||||||
|
if (extraHttpRequestParams) {
|
||||||
|
requestOptions = this.extendObj(requestOptions, extraHttpRequestParams);
|
||||||
|
}
|
||||||
|
|
||||||
return this.http.request(path, requestOptions);
|
return this.http.request(path, requestOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,3 +2,4 @@ export * from './api/api';
|
|||||||
export * from './model/models';
|
export * from './model/models';
|
||||||
export * from './variables';
|
export * from './variables';
|
||||||
export * from './configuration';
|
export * from './configuration';
|
||||||
|
export * from './api.module';
|
@ -1,4 +1,4 @@
|
|||||||
## @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201611081538
|
## @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201612061154
|
||||||
|
|
||||||
### Building
|
### Building
|
||||||
|
|
||||||
@ -19,7 +19,7 @@ navigate to the folder of your consuming project and run one of next commando's.
|
|||||||
_published:_
|
_published:_
|
||||||
|
|
||||||
```
|
```
|
||||||
npm install @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201611081538 --save
|
npm install @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201612061154 --save
|
||||||
```
|
```
|
||||||
|
|
||||||
_unPublished (not recommended):_
|
_unPublished (not recommended):_
|
||||||
|
@ -50,6 +50,7 @@ export class PetService {
|
|||||||
}
|
}
|
||||||
if (configuration) {
|
if (configuration) {
|
||||||
this.configuration = configuration;
|
this.configuration = configuration;
|
||||||
|
this.basePath = basePath || configuration.basePath || this.basePath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -268,6 +269,7 @@ export class PetService {
|
|||||||
throw new Error('Required parameter petId was null or undefined when calling deletePet.');
|
throw new Error('Required parameter petId was null or undefined when calling deletePet.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
headers.set('api_key', String(apiKey));
|
||||||
|
|
||||||
// to determine the Content-Type header
|
// to determine the Content-Type header
|
||||||
let consumes: string[] = [
|
let consumes: string[] = [
|
||||||
@ -427,17 +429,17 @@ export class PetService {
|
|||||||
'application/xml'
|
'application/xml'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// authentication (api_key) required
|
||||||
|
if (this.configuration.apiKey)
|
||||||
|
{
|
||||||
|
headers.set('api_key', this.configuration.apiKey);
|
||||||
|
}
|
||||||
// authentication (petstore_auth) required
|
// authentication (petstore_auth) required
|
||||||
// oauth required
|
// oauth required
|
||||||
if (this.configuration.accessToken)
|
if (this.configuration.accessToken)
|
||||||
{
|
{
|
||||||
headers.set('Authorization', 'Bearer ' + this.configuration.accessToken);
|
headers.set('Authorization', 'Bearer ' + this.configuration.accessToken);
|
||||||
}
|
}
|
||||||
// authentication (api_key) required
|
|
||||||
if (this.configuration.apiKey)
|
|
||||||
{
|
|
||||||
headers.set('api_key', this.configuration.apiKey);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -50,6 +50,7 @@ export class StoreService {
|
|||||||
}
|
}
|
||||||
if (configuration) {
|
if (configuration) {
|
||||||
this.configuration = configuration;
|
this.configuration = configuration;
|
||||||
|
this.basePath = basePath || configuration.basePath || this.basePath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,6 +50,7 @@ export class UserService {
|
|||||||
}
|
}
|
||||||
if (configuration) {
|
if (configuration) {
|
||||||
this.configuration = configuration;
|
this.configuration = configuration;
|
||||||
|
this.basePath = basePath || configuration.basePath || this.basePath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,24 @@
|
|||||||
export class Configuration {
|
export interface ConfigurationParameters {
|
||||||
apiKey: string;
|
apiKey?: string;
|
||||||
username: string;
|
username?: string;
|
||||||
password: string;
|
password?: string;
|
||||||
accessToken: string;
|
accessToken?: string;
|
||||||
|
basePath?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class Configuration {
|
||||||
|
apiKey: string;
|
||||||
|
username: string;
|
||||||
|
password: string;
|
||||||
|
accessToken: string;
|
||||||
|
basePath: string;
|
||||||
|
|
||||||
|
|
||||||
|
constructor(configurationParameters: ConfigurationParameters = {}) {
|
||||||
|
this.apiKey = configurationParameters.apiKey;
|
||||||
|
this.username = configurationParameters.username;
|
||||||
|
this.password = configurationParameters.password;
|
||||||
|
this.accessToken = configurationParameters.accessToken;
|
||||||
|
this.basePath = configurationParameters.basePath;
|
||||||
|
}
|
||||||
}
|
}
|
@ -2,3 +2,4 @@ export * from './api/api';
|
|||||||
export * from './model/models';
|
export * from './model/models';
|
||||||
export * from './variables';
|
export * from './variables';
|
||||||
export * from './configuration';
|
export * from './configuration';
|
||||||
|
export * from './api.module';
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@swagger/angular2-typescript-petstore",
|
"name": "@swagger/angular2-typescript-petstore",
|
||||||
"version": "0.0.1-SNAPSHOT.201611081538",
|
"version": "0.0.1-SNAPSHOT.201612061154",
|
||||||
"description": "swagger client for @swagger/angular2-typescript-petstore",
|
"description": "swagger client for @swagger/angular2-typescript-petstore",
|
||||||
"author": "Swagger Codegen Contributors",
|
"author": "Swagger Codegen Contributors",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
@ -10,8 +10,7 @@
|
|||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"typings": "dist/index.d.ts",
|
"typings": "dist/index.d.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "typings install && tsc --outDir dist/",
|
"build": "typings install && tsc --outDir dist/"
|
||||||
"postinstall": "npm run build"
|
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@angular/core": "^2.0.0",
|
"@angular/core": "^2.0.0",
|
||||||
@ -20,7 +19,7 @@
|
|||||||
"@angular/compiler": "^2.0.0",
|
"@angular/compiler": "^2.0.0",
|
||||||
"core-js": "^2.4.0",
|
"core-js": "^2.4.0",
|
||||||
"reflect-metadata": "^0.1.3",
|
"reflect-metadata": "^0.1.3",
|
||||||
"rxjs": "5.0.0-beta.6",
|
"rxjs": "5.0.0-beta.12",
|
||||||
"zone.js": "^0.6.17"
|
"zone.js": "^0.6.17"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
@ -31,9 +30,9 @@
|
|||||||
"@angular/platform-browser": "^2.0.0",
|
"@angular/platform-browser": "^2.0.0",
|
||||||
"core-js": "^2.4.0",
|
"core-js": "^2.4.0",
|
||||||
"reflect-metadata": "^0.1.3",
|
"reflect-metadata": "^0.1.3",
|
||||||
"rxjs": "5.0.0-beta.6",
|
"rxjs": "5.0.0-beta.12",
|
||||||
"zone.js": "^0.6.17",
|
"zone.js": "^0.6.17",
|
||||||
"typescript": "^1.8.10",
|
"typescript": "^2.0.0",
|
||||||
"typings": "^1.3.2"
|
"typings": "^1.3.2"
|
||||||
},
|
},
|
||||||
"publishConfig":{
|
"publishConfig":{
|
||||||
|
@ -1,27 +1,28 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"emitDecoratorMetadata": true,
|
"emitDecoratorMetadata": true,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"noImplicitAny": false,
|
"noImplicitAny": false,
|
||||||
"suppressImplicitAnyIndexErrors": true,
|
"suppressImplicitAnyIndexErrors": true,
|
||||||
"target": "es5",
|
"target": "es5",
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"removeComments": true,
|
"removeComments": true,
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"outDir": "./lib",
|
"outDir": "./lib",
|
||||||
"noLib": false,
|
"noLib": false,
|
||||||
"declaration": true
|
"declaration": true
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"node_modules",
|
"node_modules",
|
||||||
"typings/main.d.ts",
|
"typings/main.d.ts",
|
||||||
"typings/main",
|
"typings/main",
|
||||||
"lib"
|
"lib",
|
||||||
],
|
"dist"
|
||||||
"filesGlob": [
|
],
|
||||||
"./model/*.ts",
|
"filesGlob": [
|
||||||
"./api/*.ts",
|
"./model/*.ts",
|
||||||
"typings/browser.d.ts"
|
"./api/*.ts",
|
||||||
]
|
"typings/browser.d.ts"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user