forked from loafle/openapi-generator-original
update ts angular2 sample
This commit is contained in:
parent
7b7e5e25ee
commit
f63d962258
@ -27,7 +27,7 @@ import { Configuration } from '../configurat
|
|||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class PetApi {
|
export class PetApi {
|
||||||
protected basePath = '';
|
protected basePath = 'http://petstore.swagger.io/v2';
|
||||||
public defaultHeaders: Headers = new Headers();
|
public defaultHeaders: Headers = new Headers();
|
||||||
public configuration: Configuration = new Configuration();
|
public configuration: Configuration = new Configuration();
|
||||||
|
|
||||||
@ -427,6 +427,11 @@ export class PetApi {
|
|||||||
'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)
|
||||||
@ -436,11 +441,6 @@ export class PetApi {
|
|||||||
: this.configuration.accessToken;
|
: this.configuration.accessToken;
|
||||||
headers.set('Authorization', 'Bearer ' + accessToken);
|
headers.set('Authorization', 'Bearer ' + accessToken);
|
||||||
}
|
}
|
||||||
// authentication (api_key) required
|
|
||||||
if (this.configuration.apiKey)
|
|
||||||
{
|
|
||||||
headers.set('api_key', this.configuration.apiKey);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ import { Configuration } from '../configurat
|
|||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class StoreApi {
|
export class StoreApi {
|
||||||
protected basePath = '';
|
protected basePath = 'http://petstore.swagger.io/v2';
|
||||||
public defaultHeaders: Headers = new Headers();
|
public defaultHeaders: Headers = new Headers();
|
||||||
public configuration: Configuration = new Configuration();
|
public configuration: Configuration = new Configuration();
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ import { Configuration } from '../configurat
|
|||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class UserApi {
|
export class UserApi {
|
||||||
protected basePath = '';
|
protected basePath = 'http://petstore.swagger.io/v2';
|
||||||
public defaultHeaders: Headers = new Headers();
|
public defaultHeaders: Headers = new Headers();
|
||||||
public configuration: Configuration = new Configuration();
|
public configuration: Configuration = new Configuration();
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
## @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201612061134
|
## @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201612150011
|
||||||
|
|
||||||
### 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.201612061134 --save
|
npm install @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201612150011 --save
|
||||||
```
|
```
|
||||||
|
|
||||||
_unPublished (not recommended):_
|
_unPublished (not recommended):_
|
||||||
|
@ -217,7 +217,10 @@ export class PetApi {
|
|||||||
// oauth required
|
// oauth required
|
||||||
if (this.configuration.accessToken)
|
if (this.configuration.accessToken)
|
||||||
{
|
{
|
||||||
headers.set('Authorization', 'Bearer ' + this.configuration.accessToken);
|
let accessToken = typeof this.configuration.accessToken === 'function'
|
||||||
|
? this.configuration.accessToken()
|
||||||
|
: this.configuration.accessToken;
|
||||||
|
headers.set('Authorization', 'Bearer ' + accessToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -271,7 +274,10 @@ export class PetApi {
|
|||||||
// oauth required
|
// oauth required
|
||||||
if (this.configuration.accessToken)
|
if (this.configuration.accessToken)
|
||||||
{
|
{
|
||||||
headers.set('Authorization', 'Bearer ' + this.configuration.accessToken);
|
let accessToken = typeof this.configuration.accessToken === 'function'
|
||||||
|
? this.configuration.accessToken()
|
||||||
|
: this.configuration.accessToken;
|
||||||
|
headers.set('Authorization', 'Bearer ' + accessToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -320,7 +326,10 @@ export class PetApi {
|
|||||||
// oauth required
|
// oauth required
|
||||||
if (this.configuration.accessToken)
|
if (this.configuration.accessToken)
|
||||||
{
|
{
|
||||||
headers.set('Authorization', 'Bearer ' + this.configuration.accessToken);
|
let accessToken = typeof this.configuration.accessToken === 'function'
|
||||||
|
? this.configuration.accessToken()
|
||||||
|
: this.configuration.accessToken;
|
||||||
|
headers.set('Authorization', 'Bearer ' + accessToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -369,7 +378,10 @@ export class PetApi {
|
|||||||
// oauth required
|
// oauth required
|
||||||
if (this.configuration.accessToken)
|
if (this.configuration.accessToken)
|
||||||
{
|
{
|
||||||
headers.set('Authorization', 'Bearer ' + this.configuration.accessToken);
|
let accessToken = typeof this.configuration.accessToken === 'function'
|
||||||
|
? this.configuration.accessToken()
|
||||||
|
: this.configuration.accessToken;
|
||||||
|
headers.set('Authorization', 'Bearer ' + accessToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -424,7 +436,10 @@ export class PetApi {
|
|||||||
// oauth required
|
// oauth required
|
||||||
if (this.configuration.accessToken)
|
if (this.configuration.accessToken)
|
||||||
{
|
{
|
||||||
headers.set('Authorization', 'Bearer ' + this.configuration.accessToken);
|
let accessToken = typeof this.configuration.accessToken === 'function'
|
||||||
|
? this.configuration.accessToken()
|
||||||
|
: this.configuration.accessToken;
|
||||||
|
headers.set('Authorization', 'Bearer ' + accessToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -472,7 +487,10 @@ export class PetApi {
|
|||||||
// oauth required
|
// oauth required
|
||||||
if (this.configuration.accessToken)
|
if (this.configuration.accessToken)
|
||||||
{
|
{
|
||||||
headers.set('Authorization', 'Bearer ' + this.configuration.accessToken);
|
let accessToken = typeof this.configuration.accessToken === 'function'
|
||||||
|
? this.configuration.accessToken()
|
||||||
|
: this.configuration.accessToken;
|
||||||
|
headers.set('Authorization', 'Bearer ' + accessToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -529,7 +547,10 @@ export class PetApi {
|
|||||||
// oauth required
|
// oauth required
|
||||||
if (this.configuration.accessToken)
|
if (this.configuration.accessToken)
|
||||||
{
|
{
|
||||||
headers.set('Authorization', 'Bearer ' + this.configuration.accessToken);
|
let accessToken = typeof this.configuration.accessToken === 'function'
|
||||||
|
? this.configuration.accessToken()
|
||||||
|
: this.configuration.accessToken;
|
||||||
|
headers.set('Authorization', 'Bearer ' + accessToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
headers.set('Content-Type', 'application/x-www-form-urlencoded');
|
headers.set('Content-Type', 'application/x-www-form-urlencoded');
|
||||||
@ -592,7 +613,10 @@ export class PetApi {
|
|||||||
// oauth required
|
// oauth required
|
||||||
if (this.configuration.accessToken)
|
if (this.configuration.accessToken)
|
||||||
{
|
{
|
||||||
headers.set('Authorization', 'Bearer ' + this.configuration.accessToken);
|
let accessToken = typeof this.configuration.accessToken === 'function'
|
||||||
|
? this.configuration.accessToken()
|
||||||
|
: this.configuration.accessToken;
|
||||||
|
headers.set('Authorization', 'Bearer ' + accessToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
headers.set('Content-Type', 'application/x-www-form-urlencoded');
|
headers.set('Content-Type', 'application/x-www-form-urlencoded');
|
||||||
|
@ -2,5 +2,5 @@ export class Configuration {
|
|||||||
apiKey: string;
|
apiKey: string;
|
||||||
username: string;
|
username: string;
|
||||||
password: string;
|
password: string;
|
||||||
accessToken: string;
|
accessToken: string | (() => string);
|
||||||
}
|
}
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@swagger/angular2-typescript-petstore",
|
"name": "@swagger/angular2-typescript-petstore",
|
||||||
"version": "0.0.1-SNAPSHOT.201612061134",
|
"version": "0.0.1-SNAPSHOT.201612150011",
|
||||||
"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": [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user