forked from loafle/openapi-generator-original
typescript-nestjs: removed unused basePath from api.service template (#8811)
* (nestjs) removed unused basePath from api.service template 8810 * Update modules/openapi-generator/src/main/resources/typescript-nestjs/api.service.mustache Co-authored-by: Esteban Gehring <esteban.gehring@gmail.com> * added missing parenthesis on Global() decorator Co-authored-by: Esteban Gehring <esteban.gehring@gmail.com>
This commit is contained in:
parent
df1ae03960
commit
34c77c2807
@ -7,7 +7,7 @@ import { {{classname}} } from './{{importPath}}';
|
|||||||
{{/apis}}
|
{{/apis}}
|
||||||
{{/apiInfo}}
|
{{/apiInfo}}
|
||||||
|
|
||||||
@Global
|
@Global()
|
||||||
@Module({
|
@Module({
|
||||||
imports: [ HttpModule ],
|
imports: [ HttpModule ],
|
||||||
exports: [
|
exports: [
|
||||||
|
@ -1,14 +1,13 @@
|
|||||||
{{>licenseInfo}}
|
{{>licenseInfo}}
|
||||||
/* tslint:disable:no-unused-variable member-ordering */
|
/* tslint:disable:no-unused-variable member-ordering */
|
||||||
|
|
||||||
import { HttpService, Inject, Injectable } from '@nestjs/common';
|
import { HttpService, Inject, Injectable, Optional } from '@nestjs/common';
|
||||||
import { AxiosResponse } from 'axios';
|
import { AxiosResponse } from 'axios';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
{{#imports}}
|
{{#imports}}
|
||||||
import { {{classname}} } from '../{{filename}}';
|
import { {{classname}} } from '../{{filename}}';
|
||||||
{{/imports}}
|
{{/imports}}
|
||||||
import { Configuration } from '../configuration';
|
import { Configuration } from '../configuration';
|
||||||
import { COLLECTION_FORMATS } from '../variables';
|
|
||||||
{{#withInterfaces}}
|
{{#withInterfaces}}
|
||||||
import { {{classname}}Interface } from './{{classFilename}}Interface';
|
import { {{classname}}Interface } from './{{classFilename}}Interface';
|
||||||
{{/withInterfaces}}
|
{{/withInterfaces}}
|
||||||
@ -32,9 +31,9 @@ export class {{classname}} {
|
|||||||
public defaultHeaders = new Map()
|
public defaultHeaders = new Map()
|
||||||
public configuration = new Configuration();
|
public configuration = new Configuration();
|
||||||
|
|
||||||
constructor(protected httpClient: HttpService, configuration: Configuration) {
|
constructor(protected httpClient: HttpService, @Optional() configuration: Configuration) {
|
||||||
this.configuration = configuration;
|
this.configuration = configuration || this.configuration;
|
||||||
this.basePath = basePath || configuration.basePath || this.basePath;
|
this.basePath = configuration?.basePath || this.basePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -5,7 +5,7 @@ import { PetService } from './api/pet.service';
|
|||||||
import { StoreService } from './api/store.service';
|
import { StoreService } from './api/store.service';
|
||||||
import { UserService } from './api/user.service';
|
import { UserService } from './api/user.service';
|
||||||
|
|
||||||
@Global
|
@Global()
|
||||||
@Module({
|
@Module({
|
||||||
imports: [ HttpModule ],
|
imports: [ HttpModule ],
|
||||||
exports: [
|
exports: [
|
||||||
|
@ -11,13 +11,12 @@
|
|||||||
*/
|
*/
|
||||||
/* tslint:disable:no-unused-variable member-ordering */
|
/* tslint:disable:no-unused-variable member-ordering */
|
||||||
|
|
||||||
import { HttpService, Inject, Injectable } from '@nestjs/common';
|
import { HttpService, Inject, Injectable, Optional } from '@nestjs/common';
|
||||||
import { AxiosResponse } from 'axios';
|
import { AxiosResponse } from 'axios';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { ApiResponse } from '../model/apiResponse';
|
import { ApiResponse } from '../model/apiResponse';
|
||||||
import { Pet } from '../model/pet';
|
import { Pet } from '../model/pet';
|
||||||
import { Configuration } from '../configuration';
|
import { Configuration } from '../configuration';
|
||||||
import { COLLECTION_FORMATS } from '../variables';
|
|
||||||
|
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
@ -27,9 +26,9 @@ export class PetService {
|
|||||||
public defaultHeaders = new Map()
|
public defaultHeaders = new Map()
|
||||||
public configuration = new Configuration();
|
public configuration = new Configuration();
|
||||||
|
|
||||||
constructor(protected httpClient: HttpService, configuration: Configuration) {
|
constructor(protected httpClient: HttpService, @Optional() configuration: Configuration) {
|
||||||
this.configuration = configuration;
|
this.configuration = configuration || this.configuration;
|
||||||
this.basePath = basePath || configuration.basePath || this.basePath;
|
this.basePath = configuration?.basePath || this.basePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -11,12 +11,11 @@
|
|||||||
*/
|
*/
|
||||||
/* tslint:disable:no-unused-variable member-ordering */
|
/* tslint:disable:no-unused-variable member-ordering */
|
||||||
|
|
||||||
import { HttpService, Inject, Injectable } from '@nestjs/common';
|
import { HttpService, Inject, Injectable, Optional } from '@nestjs/common';
|
||||||
import { AxiosResponse } from 'axios';
|
import { AxiosResponse } from 'axios';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { Order } from '../model/order';
|
import { Order } from '../model/order';
|
||||||
import { Configuration } from '../configuration';
|
import { Configuration } from '../configuration';
|
||||||
import { COLLECTION_FORMATS } from '../variables';
|
|
||||||
|
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
@ -26,9 +25,9 @@ export class StoreService {
|
|||||||
public defaultHeaders = new Map()
|
public defaultHeaders = new Map()
|
||||||
public configuration = new Configuration();
|
public configuration = new Configuration();
|
||||||
|
|
||||||
constructor(protected httpClient: HttpService, configuration: Configuration) {
|
constructor(protected httpClient: HttpService, @Optional() configuration: Configuration) {
|
||||||
this.configuration = configuration;
|
this.configuration = configuration || this.configuration;
|
||||||
this.basePath = basePath || configuration.basePath || this.basePath;
|
this.basePath = configuration?.basePath || this.basePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -11,12 +11,11 @@
|
|||||||
*/
|
*/
|
||||||
/* tslint:disable:no-unused-variable member-ordering */
|
/* tslint:disable:no-unused-variable member-ordering */
|
||||||
|
|
||||||
import { HttpService, Inject, Injectable } from '@nestjs/common';
|
import { HttpService, Inject, Injectable, Optional } from '@nestjs/common';
|
||||||
import { AxiosResponse } from 'axios';
|
import { AxiosResponse } from 'axios';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { User } from '../model/user';
|
import { User } from '../model/user';
|
||||||
import { Configuration } from '../configuration';
|
import { Configuration } from '../configuration';
|
||||||
import { COLLECTION_FORMATS } from '../variables';
|
|
||||||
|
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
@ -26,9 +25,9 @@ export class UserService {
|
|||||||
public defaultHeaders = new Map()
|
public defaultHeaders = new Map()
|
||||||
public configuration = new Configuration();
|
public configuration = new Configuration();
|
||||||
|
|
||||||
constructor(protected httpClient: HttpService, configuration: Configuration) {
|
constructor(protected httpClient: HttpService, @Optional() configuration: Configuration) {
|
||||||
this.configuration = configuration;
|
this.configuration = configuration || this.configuration;
|
||||||
this.basePath = basePath || configuration.basePath || this.basePath;
|
this.basePath = configuration?.basePath || this.basePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user