Typescript Axios returned types and export paths fixed (#5102)

* Typescript Axiom templates fixed

Templates fixed to have `withInterfaces` and `withSeparateModelsAndApi` options working combined.

* Added petstore generated samples for typescript-axios

* Fixing line endings

* Remove unnecessary change in function signature

Co-Authored-By: Esteban Gehring <esteban.gehring@gmail.com>

* re-generate typescript-axios samples

Co-authored-by: Esteban Gehring <esteban.gehring@gmail.com>
This commit is contained in:
Marcin Stefaniuk
2020-01-27 09:40:28 +01:00
committed by Esteban Gehring
parent 45f26fe0bd
commit 19a5f1248e
11 changed files with 138 additions and 138 deletions

View File

@@ -16,6 +16,6 @@ import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } fr
{{>apiInner}}
{{/apis}}{{/apiInfo}}
{{/withSeparateModelsAndApi}}{{#withSeparateModelsAndApi}}
{{#apiInfo}}{{#apis}}{{#operations}}export * from './{{apiPackage}}/{{classFilename}}';
{{#apiInfo}}{{#apis}}{{#operations}}export * from './{{tsApiPackage}}/{{classFilename}}';
{{/operations}}{{/apis}}{{/apiInfo}}
{{/withSeparateModelsAndApi}}

View File

@@ -78,7 +78,7 @@ export const {{classname}}AxiosParamCreator = function (configuration?: Configur
{{#isBasicBasic}}
// http basic authentication required
if (configuration && (configuration.username || configuration.password)) {
localVarRequestOptions["auth"] = { username: configuration.username, password: configuration.password };
localVarRequestOptions["auth"] = { username: configuration.username, password: configuration.password };
}
{{/isBasicBasic}}
{{#isBasicBearer}}
@@ -256,7 +256,7 @@ export const {{classname}}Factory = function (configuration?: Configuration, bas
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
{{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options?: any) {
{{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options?: any): AxiosPromise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}> {
return {{classname}}Fp(configuration).{{nickname}}({{#allParams}}{{paramName}}, {{/allParams}}options)(axios, basePath);
},
{{/operation}}
@@ -284,7 +284,7 @@ export interface {{classname}}Interface {
* @throws {RequiredError}
* @memberof {{classname}}Interface
*/
{{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options?: any): AxiosPromise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}{}{{/returnType}}>;
{{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options?: any): AxiosPromise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}>;
{{/operation}}
}