From 93166dd6b5249bbf6f9b8242525575ac3e4f9e8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Wilski?= Date: Tue, 18 May 2021 08:10:44 +0200 Subject: [PATCH] fix: properly mark 'deprecated' routes in typescript-axios template #9502 (#9505) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: MichaƂ Wilski --- .../resources/typescript-axios/apiInner.mustache | 15 ++++++++++----- .../typescript-axios/builds/default/api.ts | 4 ++++ .../typescript-axios/builds/es6-target/api.ts | 4 ++++ .../builds/with-complex-headers/api.ts | 4 ++++ .../api.ts | 4 ++++ .../builds/with-interfaces/api.ts | 5 +++++ .../api/another/level/pet-api.ts | 4 ++++ .../builds/with-npm-version/api.ts | 4 ++++ .../builds/with-single-request-parameters/api.ts | 4 ++++ 9 files changed, 43 insertions(+), 5 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache b/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache index 0550c77b4d8c..b425c807a246 100644 --- a/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache @@ -34,7 +34,8 @@ export const {{classname}}AxiosParamCreator = function (configuration?: Configur {{#allParams}} * @param {{=<% %>=}}{<%&dataType%>}<%={{ }}=%> {{^required}}[{{/required}}{{paramName}}{{^required}}]{{/required}} {{description}} {{/allParams}} - * @param {*} [options] Override http request option. + * @param {*} [options] Override http request option.{{#isDeprecated}} + * @deprecated{{/isDeprecated}} * @throws {RequiredError} */ {{nickname}}: async ({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options: any = {}): Promise => { @@ -217,7 +218,8 @@ export const {{classname}}Fp = function(configuration?: Configuration) { {{#allParams}} * @param {{=<% %>=}}{<%&dataType%>}<%={{ }}=%> {{^required}}[{{/required}}{{paramName}}{{^required}}]{{/required}} {{description}} {{/allParams}} - * @param {*} [options] Override http request option. + * @param {*} [options] Override http request option.{{#isDeprecated}} + * @deprecated{{/isDeprecated}} * @throws {RequiredError} */ async {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}>> { @@ -245,7 +247,8 @@ export const {{classname}}Factory = function (configuration?: Configuration, bas {{#allParams}} * @param {{=<% %>=}}{<%&dataType%>}<%={{ }}=%> {{^required}}[{{/required}}{{paramName}}{{^required}}]{{/required}} {{description}} {{/allParams}} - * @param {*} [options] Override http request option. + * @param {*} [options] Override http request option.{{#isDeprecated}} + * @deprecated{{/isDeprecated}} * @throws {RequiredError} */ {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options?: any): AxiosPromise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}> { @@ -272,7 +275,8 @@ export interface {{classname}}Interface { {{#allParams}} * @param {{=<% %>=}}{<%&dataType%>}<%={{ }}=%> {{^required}}[{{/required}}{{paramName}}{{^required}}]{{/required}} {{description}} {{/allParams}} - * @param {*} [options] Override http request option. + * @param {*} [options] Override http request option.{{#isDeprecated}} + * @deprecated{{/isDeprecated}} * @throws {RequiredError} * @memberof {{classname}}Interface */ @@ -336,7 +340,8 @@ export class {{classname}} extends BaseAPI { * @param {{=<% %>=}}{<%&dataType%>}<%={{ }}=%> {{^required}}[{{/required}}{{paramName}}{{^required}}]{{/required}} {{description}} {{/allParams}} {{/useSingleRequestParameter}} - * @param {*} [options] Override http request option. + * @param {*} [options] Override http request option.{{#isDeprecated}} + * @deprecated{{/isDeprecated}} * @throws {RequiredError} * @memberof {{classname}} */ diff --git a/samples/client/petstore/typescript-axios/builds/default/api.ts b/samples/client/petstore/typescript-axios/builds/default/api.ts index 856fb0a48298..0ce81cf11744 100644 --- a/samples/client/petstore/typescript-axios/builds/default/api.ts +++ b/samples/client/petstore/typescript-axios/builds/default/api.ts @@ -383,6 +383,7 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) * @summary Finds Pets by tags * @param {Array} tags Tags to filter by * @param {*} [options] Override http request option. + * @deprecated * @throws {RequiredError} */ findPetsByTags: async (tags: Array, options: any = {}): Promise => { @@ -649,6 +650,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @summary Finds Pets by tags * @param {Array} tags Tags to filter by * @param {*} [options] Override http request option. + * @deprecated * @throws {RequiredError} */ async findPetsByTags(tags: Array, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { @@ -749,6 +751,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @summary Finds Pets by tags * @param {Array} tags Tags to filter by * @param {*} [options] Override http request option. + * @deprecated * @throws {RequiredError} */ findPetsByTags(tags: Array, options?: any): AxiosPromise> { @@ -850,6 +853,7 @@ export class PetApi extends BaseAPI { * @summary Finds Pets by tags * @param {Array} tags Tags to filter by * @param {*} [options] Override http request option. + * @deprecated * @throws {RequiredError} * @memberof PetApi */ diff --git a/samples/client/petstore/typescript-axios/builds/es6-target/api.ts b/samples/client/petstore/typescript-axios/builds/es6-target/api.ts index 856fb0a48298..0ce81cf11744 100644 --- a/samples/client/petstore/typescript-axios/builds/es6-target/api.ts +++ b/samples/client/petstore/typescript-axios/builds/es6-target/api.ts @@ -383,6 +383,7 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) * @summary Finds Pets by tags * @param {Array} tags Tags to filter by * @param {*} [options] Override http request option. + * @deprecated * @throws {RequiredError} */ findPetsByTags: async (tags: Array, options: any = {}): Promise => { @@ -649,6 +650,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @summary Finds Pets by tags * @param {Array} tags Tags to filter by * @param {*} [options] Override http request option. + * @deprecated * @throws {RequiredError} */ async findPetsByTags(tags: Array, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { @@ -749,6 +751,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @summary Finds Pets by tags * @param {Array} tags Tags to filter by * @param {*} [options] Override http request option. + * @deprecated * @throws {RequiredError} */ findPetsByTags(tags: Array, options?: any): AxiosPromise> { @@ -850,6 +853,7 @@ export class PetApi extends BaseAPI { * @summary Finds Pets by tags * @param {Array} tags Tags to filter by * @param {*} [options] Override http request option. + * @deprecated * @throws {RequiredError} * @memberof PetApi */ diff --git a/samples/client/petstore/typescript-axios/builds/with-complex-headers/api.ts b/samples/client/petstore/typescript-axios/builds/with-complex-headers/api.ts index 85c32a979e2d..15fa56e5e78b 100644 --- a/samples/client/petstore/typescript-axios/builds/with-complex-headers/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-complex-headers/api.ts @@ -394,6 +394,7 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) * @summary Finds Pets by tags * @param {Array} tags Tags to filter by * @param {*} [options] Override http request option. + * @deprecated * @throws {RequiredError} */ findPetsByTags: async (tags: Array, options: any = {}): Promise => { @@ -662,6 +663,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @summary Finds Pets by tags * @param {Array} tags Tags to filter by * @param {*} [options] Override http request option. + * @deprecated * @throws {RequiredError} */ async findPetsByTags(tags: Array, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { @@ -764,6 +766,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @summary Finds Pets by tags * @param {Array} tags Tags to filter by * @param {*} [options] Override http request option. + * @deprecated * @throws {RequiredError} */ findPetsByTags(tags: Array, options?: any): AxiosPromise> { @@ -867,6 +870,7 @@ export class PetApi extends BaseAPI { * @summary Finds Pets by tags * @param {Array} tags Tags to filter by * @param {*} [options] Override http request option. + * @deprecated * @throws {RequiredError} * @memberof PetApi */ diff --git a/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/api.ts b/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/api.ts index 832e63b1f4e6..c9fba6a5167f 100644 --- a/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/api.ts @@ -3089,6 +3089,7 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) * @summary Finds Pets by tags * @param {Array} tags Tags to filter by * @param {*} [options] Override http request option. + * @deprecated * @throws {RequiredError} */ findPetsByTags: async (tags: Array, options: any = {}): Promise => { @@ -3413,6 +3414,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @summary Finds Pets by tags * @param {Array} tags Tags to filter by * @param {*} [options] Override http request option. + * @deprecated * @throws {RequiredError} */ async findPetsByTags(tags: Array, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { @@ -3526,6 +3528,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @summary Finds Pets by tags * @param {Array} tags Tags to filter by * @param {*} [options] Override http request option. + * @deprecated * @throws {RequiredError} */ findPetsByTags(tags: Array, options?: any): AxiosPromise> { @@ -3639,6 +3642,7 @@ export class PetApi extends BaseAPI { * @summary Finds Pets by tags * @param {Array} tags Tags to filter by * @param {*} [options] Override http request option. + * @deprecated * @throws {RequiredError} * @memberof PetApi */ diff --git a/samples/client/petstore/typescript-axios/builds/with-interfaces/api.ts b/samples/client/petstore/typescript-axios/builds/with-interfaces/api.ts index 0368b1d57036..c6cda5b65033 100644 --- a/samples/client/petstore/typescript-axios/builds/with-interfaces/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-interfaces/api.ts @@ -383,6 +383,7 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) * @summary Finds Pets by tags * @param {Array} tags Tags to filter by * @param {*} [options] Override http request option. + * @deprecated * @throws {RequiredError} */ findPetsByTags: async (tags: Array, options: any = {}): Promise => { @@ -649,6 +650,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @summary Finds Pets by tags * @param {Array} tags Tags to filter by * @param {*} [options] Override http request option. + * @deprecated * @throws {RequiredError} */ async findPetsByTags(tags: Array, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { @@ -749,6 +751,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @summary Finds Pets by tags * @param {Array} tags Tags to filter by * @param {*} [options] Override http request option. + * @deprecated * @throws {RequiredError} */ findPetsByTags(tags: Array, options?: any): AxiosPromise> { @@ -843,6 +846,7 @@ export interface PetApiInterface { * @summary Finds Pets by tags * @param {Array} tags Tags to filter by * @param {*} [options] Override http request option. + * @deprecated * @throws {RequiredError} * @memberof PetApiInterface */ @@ -943,6 +947,7 @@ export class PetApi extends BaseAPI implements PetApiInterface { * @summary Finds Pets by tags * @param {Array} tags Tags to filter by * @param {*} [options] Override http request option. + * @deprecated * @throws {RequiredError} * @memberof PetApi */ diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/pet-api.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/pet-api.ts index fc66c5184fab..03545d554fcf 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/pet-api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/api/another/level/pet-api.ts @@ -159,6 +159,7 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) * @summary Finds Pets by tags * @param {Array} tags Tags to filter by * @param {*} [options] Override http request option. + * @deprecated * @throws {RequiredError} */ findPetsByTags: async (tags: Array, options: any = {}): Promise => { @@ -425,6 +426,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @summary Finds Pets by tags * @param {Array} tags Tags to filter by * @param {*} [options] Override http request option. + * @deprecated * @throws {RequiredError} */ async findPetsByTags(tags: Array, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { @@ -525,6 +527,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @summary Finds Pets by tags * @param {Array} tags Tags to filter by * @param {*} [options] Override http request option. + * @deprecated * @throws {RequiredError} */ findPetsByTags(tags: Array, options?: any): AxiosPromise> { @@ -626,6 +629,7 @@ export class PetApi extends BaseAPI { * @summary Finds Pets by tags * @param {Array} tags Tags to filter by * @param {*} [options] Override http request option. + * @deprecated * @throws {RequiredError} * @memberof PetApi */ diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version/api.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version/api.ts index 856fb0a48298..0ce81cf11744 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version/api.ts @@ -383,6 +383,7 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) * @summary Finds Pets by tags * @param {Array} tags Tags to filter by * @param {*} [options] Override http request option. + * @deprecated * @throws {RequiredError} */ findPetsByTags: async (tags: Array, options: any = {}): Promise => { @@ -649,6 +650,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @summary Finds Pets by tags * @param {Array} tags Tags to filter by * @param {*} [options] Override http request option. + * @deprecated * @throws {RequiredError} */ async findPetsByTags(tags: Array, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { @@ -749,6 +751,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @summary Finds Pets by tags * @param {Array} tags Tags to filter by * @param {*} [options] Override http request option. + * @deprecated * @throws {RequiredError} */ findPetsByTags(tags: Array, options?: any): AxiosPromise> { @@ -850,6 +853,7 @@ export class PetApi extends BaseAPI { * @summary Finds Pets by tags * @param {Array} tags Tags to filter by * @param {*} [options] Override http request option. + * @deprecated * @throws {RequiredError} * @memberof PetApi */ diff --git a/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/api.ts b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/api.ts index ec1563347136..1f8764baaf07 100644 --- a/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/api.ts @@ -383,6 +383,7 @@ export const PetApiAxiosParamCreator = function (configuration?: Configuration) * @summary Finds Pets by tags * @param {Array} tags Tags to filter by * @param {*} [options] Override http request option. + * @deprecated * @throws {RequiredError} */ findPetsByTags: async (tags: Array, options: any = {}): Promise => { @@ -649,6 +650,7 @@ export const PetApiFp = function(configuration?: Configuration) { * @summary Finds Pets by tags * @param {Array} tags Tags to filter by * @param {*} [options] Override http request option. + * @deprecated * @throws {RequiredError} */ async findPetsByTags(tags: Array, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { @@ -749,6 +751,7 @@ export const PetApiFactory = function (configuration?: Configuration, basePath?: * @summary Finds Pets by tags * @param {Array} tags Tags to filter by * @param {*} [options] Override http request option. + * @deprecated * @throws {RequiredError} */ findPetsByTags(tags: Array, options?: any): AxiosPromise> { @@ -996,6 +999,7 @@ export class PetApi extends BaseAPI { * @summary Finds Pets by tags * @param {PetApiFindPetsByTagsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. + * @deprecated * @throws {RequiredError} * @memberof PetApi */