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[] = [
|
||||||
|
@ -53,6 +53,21 @@ export class PetService {
|
|||||||
this.basePath = basePath || configuration.basePath || this.basePath;
|
this.basePath = basePath || configuration.basePath || this.basePath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* 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,9 +242,13 @@ 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,9 +294,13 @@ 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,9 +343,13 @@ 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,9 +392,13 @@ 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,9 +447,13 @@ 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,9 +497,13 @@ 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,9 +560,13 @@ 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,9 +623,13 @@ 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);
|
||||||
}
|
}
|
||||||
|
@ -53,6 +53,21 @@ export class StoreService {
|
|||||||
this.basePath = basePath || configuration.basePath || this.basePath;
|
this.basePath = basePath || configuration.basePath || this.basePath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* 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
|
||||||
@ -151,9 +166,13 @@ 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,9 +210,13 @@ 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,9 +254,13 @@ 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,9 +296,13 @@ 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);
|
||||||
}
|
}
|
||||||
|
@ -53,6 +53,21 @@ export class UserService {
|
|||||||
this.basePath = basePath || configuration.basePath || this.basePath;
|
this.basePath = basePath || configuration.basePath || this.basePath;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* 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
|
||||||
@ -215,9 +230,13 @@ 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,9 +272,13 @@ 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,9 +314,13 @@ 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,9 +358,13 @@ 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,9 +402,13 @@ 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,9 +449,13 @@ 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,9 +488,13 @@ 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,9 +535,13 @@ 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);
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
export * from './api/api';
|
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):_
|
||||||
@ -41,4 +41,4 @@ import { BASE_PATH } from './path-to-swagger-gen-service/index';
|
|||||||
bootstrap(AppComponent, [
|
bootstrap(AppComponent, [
|
||||||
{ provide: BASE_PATH, useValue: 'https://your-web-service.com' },
|
{ provide: BASE_PATH, useValue: 'https://your-web-service.com' },
|
||||||
]);
|
]);
|
||||||
```
|
```
|
@ -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 interface ConfigurationParameters {
|
||||||
|
apiKey?: string;
|
||||||
|
username?: string;
|
||||||
|
password?: string;
|
||||||
|
accessToken?: string;
|
||||||
|
basePath?: string;
|
||||||
|
}
|
||||||
|
|
||||||
export class Configuration {
|
export class Configuration {
|
||||||
apiKey: string;
|
apiKey: string;
|
||||||
username: string;
|
username: string;
|
||||||
password: string;
|
password: string;
|
||||||
accessToken: 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
export * from './api/api';
|
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