mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-08 03:18:53 +00:00
Add Opeiontal decorator to basePath
This commit is contained in:
parent
949da93a05
commit
366c7d6917
@ -1,5 +1,5 @@
|
||||
import {Http, Headers, RequestOptionsArgs, Response, URLSearchParams} from '@angular/http';
|
||||
import {Injectable} from '@angular/core';
|
||||
import {Injectable, Optional} from '@angular/core';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import * as models from '../model/models';
|
||||
|
||||
@ -18,10 +18,10 @@ export class {{classname}} {
|
||||
protected basePath = '{{basePath}}';
|
||||
public defaultHeaders : Headers = new Headers();
|
||||
|
||||
constructor(protected http: Http) {}
|
||||
|
||||
setBasePath(basePath: string) {
|
||||
this.basePath = basePath;
|
||||
constructor(protected http: Http, @Optional() basePath: string) {
|
||||
if (basePath) {
|
||||
this.basePath = basePath;
|
||||
}
|
||||
}
|
||||
|
||||
{{#operation}}
|
||||
|
@ -1,5 +1,5 @@
|
||||
import {Http, Headers, RequestOptionsArgs, Response, URLSearchParams} from '@angular/http';
|
||||
import {Injectable} from '@angular/core';
|
||||
import {Injectable, Optional} from '@angular/core';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import * as models from '../model/models';
|
||||
|
||||
@ -12,10 +12,10 @@ export class PetApi {
|
||||
protected basePath = 'http://petstore.swagger.io/v2';
|
||||
public defaultHeaders : Headers = new Headers();
|
||||
|
||||
constructor(protected http: Http) {}
|
||||
|
||||
setBasePath(basePath: string) {
|
||||
this.basePath = basePath;
|
||||
constructor(protected http: Http, @Optional() basePath: string) {
|
||||
if (basePath) {
|
||||
this.basePath = basePath;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,5 +1,5 @@
|
||||
import {Http, Headers, RequestOptionsArgs, Response, URLSearchParams} from '@angular/http';
|
||||
import {Injectable} from '@angular/core';
|
||||
import {Injectable, Optional} from '@angular/core';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import * as models from '../model/models';
|
||||
|
||||
@ -12,10 +12,10 @@ export class StoreApi {
|
||||
protected basePath = 'http://petstore.swagger.io/v2';
|
||||
public defaultHeaders : Headers = new Headers();
|
||||
|
||||
constructor(protected http: Http) {}
|
||||
|
||||
setBasePath(basePath: string) {
|
||||
this.basePath = basePath;
|
||||
constructor(protected http: Http, @Optional() basePath: string) {
|
||||
if (basePath) {
|
||||
this.basePath = basePath;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,5 +1,5 @@
|
||||
import {Http, Headers, RequestOptionsArgs, Response, URLSearchParams} from '@angular/http';
|
||||
import {Injectable} from '@angular/core';
|
||||
import {Injectable, Optional} from '@angular/core';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import * as models from '../model/models';
|
||||
|
||||
@ -12,10 +12,10 @@ export class UserApi {
|
||||
protected basePath = 'http://petstore.swagger.io/v2';
|
||||
public defaultHeaders : Headers = new Headers();
|
||||
|
||||
constructor(protected http: Http) {}
|
||||
|
||||
setBasePath(basePath: string) {
|
||||
this.basePath = basePath;
|
||||
constructor(protected http: Http, @Optional() basePath: string) {
|
||||
if (basePath) {
|
||||
this.basePath = basePath;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,4 +1,4 @@
|
||||
## @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201605041712
|
||||
## @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201605041838
|
||||
|
||||
### 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.201605041712 --save
|
||||
npm install @swagger/angular2-typescript-petstore@0.0.1-SNAPSHOT.201605041838 --save
|
||||
```
|
||||
|
||||
_unPublished (not recommended):_
|
||||
|
@ -1,5 +1,5 @@
|
||||
import {Http, Headers, RequestOptionsArgs, Response, URLSearchParams} from '@angular/http';
|
||||
import {Injectable} from '@angular/core';
|
||||
import {Injectable, Optional} from '@angular/core';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import * as models from '../model/models';
|
||||
|
||||
@ -12,10 +12,10 @@ export class PetApi {
|
||||
protected basePath = 'http://petstore.swagger.io/v2';
|
||||
public defaultHeaders : Headers = new Headers();
|
||||
|
||||
constructor(protected http: Http) {}
|
||||
|
||||
setBasePath(basePath: string) {
|
||||
this.basePath = basePath;
|
||||
constructor(protected http: Http, @Optional() basePath: string) {
|
||||
if (basePath) {
|
||||
this.basePath = basePath;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,5 +1,5 @@
|
||||
import {Http, Headers, RequestOptionsArgs, Response, URLSearchParams} from '@angular/http';
|
||||
import {Injectable} from '@angular/core';
|
||||
import {Injectable, Optional} from '@angular/core';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import * as models from '../model/models';
|
||||
|
||||
@ -12,10 +12,10 @@ export class StoreApi {
|
||||
protected basePath = 'http://petstore.swagger.io/v2';
|
||||
public defaultHeaders : Headers = new Headers();
|
||||
|
||||
constructor(protected http: Http) {}
|
||||
|
||||
setBasePath(basePath: string) {
|
||||
this.basePath = basePath;
|
||||
constructor(protected http: Http, @Optional() basePath: string) {
|
||||
if (basePath) {
|
||||
this.basePath = basePath;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,5 +1,5 @@
|
||||
import {Http, Headers, RequestOptionsArgs, Response, URLSearchParams} from '@angular/http';
|
||||
import {Injectable} from '@angular/core';
|
||||
import {Injectable, Optional} from '@angular/core';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import * as models from '../model/models';
|
||||
|
||||
@ -12,10 +12,10 @@ export class UserApi {
|
||||
protected basePath = 'http://petstore.swagger.io/v2';
|
||||
public defaultHeaders : Headers = new Headers();
|
||||
|
||||
constructor(protected http: Http) {}
|
||||
|
||||
setBasePath(basePath: string) {
|
||||
this.basePath = basePath;
|
||||
constructor(protected http: Http, @Optional() basePath: string) {
|
||||
if (basePath) {
|
||||
this.basePath = basePath;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@swagger/angular2-typescript-petstore",
|
||||
"version": "0.0.1-SNAPSHOT.201605041712",
|
||||
"version": "0.0.1-SNAPSHOT.201605041838",
|
||||
"description": "swagger client for @swagger/angular2-typescript-petstore",
|
||||
"author": "Swagger Codegen Contributors",
|
||||
"keywords": [
|
||||
|
Loading…
Reference in New Issue
Block a user