swagger-axios-codegen
Advanced tools
Comparing version 0.11.7 to 0.11.8
## 0.11.8 | ||
- fix basePath | ||
### 0.11.7 | ||
@@ -3,0 +7,0 @@ |
@@ -78,3 +78,3 @@ "use strict"; | ||
let apiSource = ''; | ||
let serviceHeaderSource = options.useCustomerRequestInstance ? serviceHeader_1.customerServiceHeader(options, swaggerSource.basePath) : serviceHeader_1.serviceHeader(options, swaggerSource.basePath); | ||
let serviceHeaderSource = options.useCustomerRequestInstance ? serviceHeader_1.customerServiceHeader(options) : serviceHeader_1.serviceHeader(options); | ||
if (options.sharedServiceOptions) { | ||
@@ -87,2 +87,3 @@ writeFile(options.outputDir || '', 'serviceOptions.ts' || '', format(serviceHeaderSource, options)); | ||
} | ||
apiSource += `const basePath = '${utils_1.trimString(swaggerSource.basePath, '/', 'right')}'`; | ||
apiSource += serviceHeader_1.definitionHeader(options.extendDefinitionFile); | ||
@@ -89,0 +90,0 @@ // 判断是否是openApi3.0或者swagger3.0 |
@@ -27,7 +27,9 @@ "use strict"; | ||
export interface IPagedResult<T> extends IListResult<T> { | ||
totalCount: number | ||
totalCount?: number; | ||
items?: T[]; | ||
} | ||
export class PagedResultDto<T> implements IPagedResult<T> { | ||
totalCount!: number | ||
totalCount?: number; | ||
items?: T[]; | ||
} | ||
@@ -34,0 +36,0 @@ `; |
import { ISwaggerOptions } from "../baseInterfaces"; | ||
export declare function serviceHeader(options: ISwaggerOptions, basePath: string): string; | ||
export declare function customerServiceHeader(options: ISwaggerOptions, basePath: string): string; | ||
export declare function serviceHeader(options: ISwaggerOptions): string; | ||
export declare function customerServiceHeader(options: ISwaggerOptions): string; | ||
export declare function definitionHeader(fileDir: string | undefined): string; |
@@ -13,4 +13,3 @@ "use strict"; | ||
const genericTypeDefinitionTemplate_1 = require("./genericTypeDefinitionTemplate"); | ||
const utils_1 = require("../utils"); | ||
function serviceHeader(options, basePath) { | ||
function serviceHeader(options) { | ||
const classTransformerImport = options.useClassTransformer | ||
@@ -24,3 +23,2 @@ ? `import { Expose, Transform, Type, plainToClass } from 'class-transformer'; | ||
const basePath = '${utils_1.trimString(basePath, '/', 'right')}' | ||
${classTransformerImport} | ||
@@ -51,3 +49,3 @@ | ||
exports.serviceHeader = serviceHeader; | ||
function customerServiceHeader(options, basePath) { | ||
function customerServiceHeader(options) { | ||
return `/** Generate by swagger-axios-codegen */ | ||
@@ -85,4 +83,2 @@ // tslint:disable | ||
const basePath = '${basePath}' | ||
// Add options interface | ||
@@ -120,3 +116,2 @@ export interface ServiceOptions { | ||
export function getConfigs(method: string, contentType: string, url: string,options: any):IRequestConfig { | ||
url = basePath + url | ||
const configs: IRequestConfig = { ...options, method, url }; | ||
@@ -123,0 +118,0 @@ configs.headers = { |
@@ -152,3 +152,3 @@ "use strict"; | ||
return new Promise((resolve, reject) => { | ||
let url = '${path}' | ||
let url = basePath+'${path}' | ||
${pathReplace} | ||
@@ -155,0 +155,0 @@ ${parsedParameters && headerParameters && headerParameters.length > 0 |
{ | ||
"name": "swagger-axios-codegen", | ||
"version": "0.11.7", | ||
"version": "0.11.8", | ||
"main": "./dist/index", | ||
@@ -39,4 +39,4 @@ "typings": "./dist/", | ||
"tslint": "^5.10.0", | ||
"typescript": "^3.7.2" | ||
"typescript": "^4.0.2" | ||
} | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
461569
161
6490
15
1