From 96b44ce72761e59b95a3abada05a199918fb9e96 Mon Sep 17 00:00:00 2001 From: scarf Date: Thu, 21 Aug 2025 15:50:22 +0900 Subject: [PATCH] [typescript-axios]: align jsdoc for `@deprecated` (#21778) * refactor: simplify `description` OR `deprecated` template * chore: update generator output --------- Co-authored-by: nocontribute <> --- .../typescript-axios/modelGeneric.mustache | 13 ++-- .../echo_api/typescript-axios/build/api.ts | 20 +++--- .../typescript-axios/builds/default/api.ts | 12 ++-- .../typescript-axios/builds/es6-target/api.ts | 12 ++-- .../builds/test-petstore/api.ts | 63 +++++++++---------- .../builds/with-complex-headers/api.ts | 12 ++-- .../api.ts | 46 +++++++------- .../api.ts | 12 ++-- .../builds/with-interfaces/api.ts | 12 ++-- .../builds/with-node-imports/api.ts | 12 ++-- .../model/some/levels/deep/order.ts | 4 +- .../model/some/levels/deep/pet.ts | 4 +- .../model/some/levels/deep/user.ts | 4 +- .../builds/with-npm-version/api.ts | 12 ++-- .../with-single-request-parameters/api.ts | 12 ++-- .../builds/with-string-enums/api.ts | 12 ++-- 16 files changed, 128 insertions(+), 134 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/typescript-axios/modelGeneric.mustache b/modules/openapi-generator/src/main/resources/typescript-axios/modelGeneric.mustache index 5c515f04dcd..16d43b58d66 100644 --- a/modules/openapi-generator/src/main/resources/typescript-axios/modelGeneric.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-axios/modelGeneric.mustache @@ -11,20 +11,17 @@ export interface {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{ {{#vars}} {{#description}} /** - * {{{description}}} + * {{{description}}} {{#deprecated}} - * @deprecated + * @deprecated {{/deprecated}} - */ + */ {{/description}} {{^description}} {{#deprecated}} /** - * - {{#deprecated}} - * @deprecated - {{/deprecated}} - */ + * @deprecated + */ {{/deprecated}} {{/description}} '{{baseName}}'{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isNullable}} | null{{/isNullable}}; diff --git a/samples/client/echo_api/typescript-axios/build/api.ts b/samples/client/echo_api/typescript-axios/build/api.ts index 9a7c68a5dff..f7ce15862e3 100644 --- a/samples/client/echo_api/typescript-axios/build/api.ts +++ b/samples/client/echo_api/typescript-axios/build/api.ts @@ -33,16 +33,16 @@ export interface Category { } export interface DataQuery extends Query { /** - * test suffix - */ + * test suffix + */ 'suffix'?: string; /** - * Some text containing white spaces - */ + * Some text containing white spaces + */ 'text'?: string; /** - * A date - */ + * A date + */ 'date'?: string; } @@ -81,8 +81,8 @@ export interface Pet { 'photoUrls': Array; 'tags'?: Array; /** - * pet status in the store - */ + * pet status in the store + */ 'status'?: PetStatusEnum; } @@ -96,8 +96,8 @@ export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum]; export interface Query { /** - * Query - */ + * Query + */ 'id'?: number; 'outcomes'?: Array; } diff --git a/samples/client/petstore/typescript-axios/builds/default/api.ts b/samples/client/petstore/typescript-axios/builds/default/api.ts index 22a7ff99e9f..fde2a4d2078 100644 --- a/samples/client/petstore/typescript-axios/builds/default/api.ts +++ b/samples/client/petstore/typescript-axios/builds/default/api.ts @@ -47,8 +47,8 @@ export interface Order { 'quantity'?: number; 'shipDate'?: string; /** - * Order Status - */ + * Order Status + */ 'status'?: OrderStatusEnum; 'complete'?: boolean; } @@ -71,8 +71,8 @@ export interface Pet { 'photoUrls': Array; 'tags'?: Array; /** - * pet status in the store - */ + * pet status in the store + */ 'status'?: PetStatusEnum; } @@ -103,8 +103,8 @@ export interface User { 'password'?: string; 'phone'?: string; /** - * User Status - */ + * User Status + */ 'userStatus'?: number; } 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 22a7ff99e9f..fde2a4d2078 100644 --- a/samples/client/petstore/typescript-axios/builds/es6-target/api.ts +++ b/samples/client/petstore/typescript-axios/builds/es6-target/api.ts @@ -47,8 +47,8 @@ export interface Order { 'quantity'?: number; 'shipDate'?: string; /** - * Order Status - */ + * Order Status + */ 'status'?: OrderStatusEnum; 'complete'?: boolean; } @@ -71,8 +71,8 @@ export interface Pet { 'photoUrls': Array; 'tags'?: Array; /** - * pet status in the store - */ + * pet status in the store + */ 'status'?: PetStatusEnum; } @@ -103,8 +103,8 @@ export interface User { 'password'?: string; 'phone'?: string; /** - * User Status - */ + * User Status + */ 'userStatus'?: number; } diff --git a/samples/client/petstore/typescript-axios/builds/test-petstore/api.ts b/samples/client/petstore/typescript-axios/builds/test-petstore/api.ts index 96b6c5e4ffe..b7775a68042 100644 --- a/samples/client/petstore/typescript-axios/builds/test-petstore/api.ts +++ b/samples/client/petstore/typescript-axios/builds/test-petstore/api.ts @@ -31,8 +31,8 @@ export interface AdditionalPropertiesClass { 'map_with_undeclared_properties_anytype_2'?: object; 'map_with_undeclared_properties_anytype_3'?: { [key: string]: any; }; /** - * an object with no declared properties and no undeclared properties, hence it\'s an empty map. - */ + * an object with no declared properties and no undeclared properties, hence it\'s an empty map. + */ 'empty_map'?: object; 'map_with_undeclared_properties_string'?: { [key: string]: string; }; } @@ -81,8 +81,8 @@ export interface Capitalization { 'Capital_Snake'?: string; 'SCA_ETH_Flow_Points'?: string; /** - * Name of the pet - */ + * Name of the pet + */ 'ATT_NAME'?: string; } export interface Cat extends Animal { @@ -236,12 +236,12 @@ export interface FormatTest { 'uuid'?: string; 'password': string; /** - * A string that is a 10 digit number. Can have leading zeros. - */ + * A string that is a 10 digit number. Can have leading zeros. + */ 'pattern_with_digits'?: string; /** - * A string starting with \'image_\' (case insensitive) and one to three digits following i.e. Image_01. - */ + * A string starting with \'image_\' (case insensitive) and one to three digits following i.e. Image_01. + */ 'pattern_with_digits_and_delimiter'?: string; } /** @@ -331,8 +331,8 @@ export interface Model200Response { */ export interface ModelFile { /** - * Test capitalization - */ + * Test capitalization + */ 'sourceURI'?: string; } /** @@ -372,19 +372,16 @@ export interface NumberOnly { export interface ObjectWithDeprecatedFields { 'uuid'?: string; /** - * - * @deprecated - */ + * @deprecated + */ 'id'?: number; /** - * - * @deprecated - */ + * @deprecated + */ 'deprecatedRef'?: DeprecatedObject; /** - * - * @deprecated - */ + * @deprecated + */ 'bars'?: Array; } export interface Order { @@ -393,8 +390,8 @@ export interface Order { 'quantity'?: number; 'shipDate'?: string; /** - * Order Status - */ + * Order Status + */ 'status'?: OrderStatusEnum; 'complete'?: boolean; } @@ -461,8 +458,8 @@ export interface Pet { 'photoUrls': Array; 'tags'?: Array; /** - * pet status in the store - */ + * pet status in the store + */ 'status'?: PetStatusEnum; } @@ -549,24 +546,24 @@ export interface User { 'password'?: string; 'phone'?: string; /** - * User Status - */ + * User Status + */ 'userStatus'?: number; /** - * test code generation for objects Value must be a map of strings to values. It cannot be the \'null\' value. - */ + * test code generation for objects Value must be a map of strings to values. It cannot be the \'null\' value. + */ 'objectWithNoDeclaredProps'?: object; /** - * test code generation for nullable objects. Value must be a map of strings to values or the \'null\' value. - */ + * test code generation for nullable objects. Value must be a map of strings to values or the \'null\' value. + */ 'objectWithNoDeclaredPropsNullable'?: object | null; /** - * test code generation for any type Here the \'type\' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 - */ + * test code generation for any type Here the \'type\' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 + */ 'anyTypeProp'?: any; /** - * test code generation for any type Here the \'type\' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The \'nullable\' attribute does not change the allowed values. - */ + * test code generation for any type Here the \'type\' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The \'nullable\' attribute does not change the allowed values. + */ 'anyTypePropNullable'?: any | null; } export interface Whale { 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 8b148254082..e327bd51a1d 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 @@ -56,8 +56,8 @@ export interface Order { 'quantity'?: number; 'shipDate'?: string; /** - * Order Status - */ + * Order Status + */ 'status'?: OrderStatusEnum; 'complete'?: boolean; } @@ -80,8 +80,8 @@ export interface Pet { 'photoUrls': Array; 'tags'?: Array; /** - * pet status in the store - */ + * pet status in the store + */ 'status'?: PetStatusEnum; } @@ -112,8 +112,8 @@ export interface User { 'password'?: string; 'phone'?: string; /** - * User Status - */ + * User Status + */ 'userStatus'?: number; } 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 d09a7251e6f..91dd39a88dd 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 @@ -70,8 +70,8 @@ export interface Capitalization { 'Capital_Snake'?: string; 'SCA_ETH_Flow_Points'?: string; /** - * Name of the pet - */ + * Name of the pet + */ 'ATT_NAME'?: string; } export interface Cat extends Animal { @@ -184,12 +184,12 @@ export interface FormatTest { 'uuid'?: string; 'password': string; /** - * A string that is a 10 digit number. Can have leading zeros. - */ + * A string that is a 10 digit number. Can have leading zeros. + */ 'pattern_with_digits'?: string; /** - * A string starting with \'image_\' (case insensitive) and one to three digits following i.e. Image_01. - */ + * A string starting with \'image_\' (case insensitive) and one to three digits following i.e. Image_01. + */ 'pattern_with_digits_and_delimiter'?: string; } /** @@ -256,8 +256,8 @@ export interface Model200Response { */ export interface ModelFile { /** - * Test capitalization - */ + * Test capitalization + */ 'sourceURI'?: string; } /** @@ -294,8 +294,8 @@ export interface Order { 'quantity'?: number; 'shipDate'?: string; /** - * Order Status - */ + * Order Status + */ 'status'?: OrderStatusEnum; 'complete'?: boolean; } @@ -360,9 +360,9 @@ export interface Pet { 'photoUrls': Array; 'tags'?: Array; /** - * pet status in the store - * @deprecated - */ + * pet status in the store + * @deprecated + */ 'status'?: PetStatusEnum; } @@ -414,24 +414,24 @@ export interface User { 'password'?: string; 'phone'?: string; /** - * User Status - */ + * User Status + */ 'userStatus'?: number; /** - * test code generation for objects Value must be a map of strings to values. It cannot be the \'null\' value. - */ + * test code generation for objects Value must be a map of strings to values. It cannot be the \'null\' value. + */ 'arbitraryObject'?: object; /** - * test code generation for nullable objects. Value must be a map of strings to values or the \'null\' value. - */ + * test code generation for nullable objects. Value must be a map of strings to values or the \'null\' value. + */ 'arbitraryNullableObject'?: object | null; /** - * test code generation for any type Value can be any type - string, number, boolean, array or object. - */ + * test code generation for any type Value can be any type - string, number, boolean, array or object. + */ 'arbitraryTypeValue'?: any; /** - * test code generation for any type Value can be any type - string, number, boolean, array, object or the \'null\' value. - */ + * test code generation for any type Value can be any type - string, number, boolean, array, object or the \'null\' value. + */ 'arbitraryNullableTypeValue'?: any | null; } export interface Whale { diff --git a/samples/client/petstore/typescript-axios/builds/with-interfaces-and-with-single-request-param/api.ts b/samples/client/petstore/typescript-axios/builds/with-interfaces-and-with-single-request-param/api.ts index fc6fd196c7a..40892b8dc94 100644 --- a/samples/client/petstore/typescript-axios/builds/with-interfaces-and-with-single-request-param/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-interfaces-and-with-single-request-param/api.ts @@ -47,8 +47,8 @@ export interface Order { 'quantity'?: number; 'shipDate'?: string; /** - * Order Status - */ + * Order Status + */ 'status'?: OrderStatusEnum; 'complete'?: boolean; } @@ -71,8 +71,8 @@ export interface Pet { 'photoUrls': Array; 'tags'?: Array; /** - * pet status in the store - */ + * pet status in the store + */ 'status'?: PetStatusEnum; } @@ -103,8 +103,8 @@ export interface User { 'password'?: string; 'phone'?: string; /** - * User Status - */ + * User Status + */ 'userStatus'?: number; } 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 997cad9167d..0fee30e0197 100644 --- a/samples/client/petstore/typescript-axios/builds/with-interfaces/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-interfaces/api.ts @@ -47,8 +47,8 @@ export interface Order { 'quantity'?: number; 'shipDate'?: string; /** - * Order Status - */ + * Order Status + */ 'status'?: OrderStatusEnum; 'complete'?: boolean; } @@ -71,8 +71,8 @@ export interface Pet { 'photoUrls': Array; 'tags'?: Array; /** - * pet status in the store - */ + * pet status in the store + */ 'status'?: PetStatusEnum; } @@ -103,8 +103,8 @@ export interface User { 'password'?: string; 'phone'?: string; /** - * User Status - */ + * User Status + */ 'userStatus'?: number; } diff --git a/samples/client/petstore/typescript-axios/builds/with-node-imports/api.ts b/samples/client/petstore/typescript-axios/builds/with-node-imports/api.ts index 9887f1c7fad..3b0ab1b4dce 100644 --- a/samples/client/petstore/typescript-axios/builds/with-node-imports/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-node-imports/api.ts @@ -51,8 +51,8 @@ export interface Order { 'quantity'?: number; 'shipDate'?: string; /** - * Order Status - */ + * Order Status + */ 'status'?: OrderStatusEnum; 'complete'?: boolean; } @@ -75,8 +75,8 @@ export interface Pet { 'photoUrls': Array; 'tags'?: Array; /** - * pet status in the store - */ + * pet status in the store + */ 'status'?: PetStatusEnum; } @@ -107,8 +107,8 @@ export interface User { 'password'?: string; 'phone'?: string; /** - * User Status - */ + * User Status + */ 'userStatus'?: number; } diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/model/some/levels/deep/order.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/model/some/levels/deep/order.ts index 3d93c81bdec..4ffbce0f9e1 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/model/some/levels/deep/order.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/model/some/levels/deep/order.ts @@ -23,8 +23,8 @@ export interface Order { 'quantity'?: number; 'shipDate'?: string; /** - * Order Status - */ + * Order Status + */ 'status'?: OrderStatusEnum; 'complete'?: boolean; } diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/model/some/levels/deep/pet.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/model/some/levels/deep/pet.ts index 55e3a08cf99..ee25eb132d0 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/model/some/levels/deep/pet.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/model/some/levels/deep/pet.ts @@ -30,8 +30,8 @@ export interface Pet { 'photoUrls': Array; 'tags'?: Array; /** - * pet status in the store - */ + * pet status in the store + */ 'status'?: PetStatusEnum; } diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/model/some/levels/deep/user.ts b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/model/some/levels/deep/user.ts index 24242f6738f..f729fd3b019 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/model/some/levels/deep/user.ts +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/model/some/levels/deep/user.ts @@ -26,8 +26,8 @@ export interface User { 'password'?: string; 'phone'?: string; /** - * User Status - */ + * User Status + */ 'userStatus'?: number; } 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 22a7ff99e9f..fde2a4d2078 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 @@ -47,8 +47,8 @@ export interface Order { 'quantity'?: number; 'shipDate'?: string; /** - * Order Status - */ + * Order Status + */ 'status'?: OrderStatusEnum; 'complete'?: boolean; } @@ -71,8 +71,8 @@ export interface Pet { 'photoUrls': Array; 'tags'?: Array; /** - * pet status in the store - */ + * pet status in the store + */ 'status'?: PetStatusEnum; } @@ -103,8 +103,8 @@ export interface User { 'password'?: string; 'phone'?: string; /** - * User Status - */ + * User Status + */ 'userStatus'?: number; } 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 9070fc0d75b..a4d2f4562a7 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 @@ -47,8 +47,8 @@ export interface Order { 'quantity'?: number; 'shipDate'?: string; /** - * Order Status - */ + * Order Status + */ 'status'?: OrderStatusEnum; 'complete'?: boolean; } @@ -71,8 +71,8 @@ export interface Pet { 'photoUrls': Array; 'tags'?: Array; /** - * pet status in the store - */ + * pet status in the store + */ 'status'?: PetStatusEnum; } @@ -103,8 +103,8 @@ export interface User { 'password'?: string; 'phone'?: string; /** - * User Status - */ + * User Status + */ 'userStatus'?: number; } diff --git a/samples/client/petstore/typescript-axios/builds/with-string-enums/api.ts b/samples/client/petstore/typescript-axios/builds/with-string-enums/api.ts index 48406b52c3c..04accd98841 100644 --- a/samples/client/petstore/typescript-axios/builds/with-string-enums/api.ts +++ b/samples/client/petstore/typescript-axios/builds/with-string-enums/api.ts @@ -47,8 +47,8 @@ export interface Order { 'quantity'?: number; 'shipDate'?: string; /** - * Order Status - */ + * Order Status + */ 'status'?: OrderStatusEnum; 'complete'?: boolean; } @@ -69,8 +69,8 @@ export interface Pet { 'photoUrls': Array; 'tags'?: Array; /** - * pet status in the store - */ + * pet status in the store + */ 'status'?: PetStatusEnum; } @@ -99,8 +99,8 @@ export interface User { 'password'?: string; 'phone'?: string; /** - * User Status - */ + * User Status + */ 'userStatus'?: number; }