Skip to content

Commit 96b44ce

Browse files
authored
[typescript-axios]: align jsdoc for @deprecated (#21778)
* refactor: simplify `description` OR `deprecated` template * chore: update generator output --------- Co-authored-by: nocontribute <>
1 parent caf53ac commit 96b44ce

File tree

16 files changed

+128
-134
lines changed

16 files changed

+128
-134
lines changed

modules/openapi-generator/src/main/resources/typescript-axios/modelGeneric.mustache

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,17 @@ export interface {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{
1111
{{#vars}}
1212
{{#description}}
1313
/**
14-
* {{{description}}}
14+
* {{{description}}}
1515
{{#deprecated}}
16-
* @deprecated
16+
* @deprecated
1717
{{/deprecated}}
18-
*/
18+
*/
1919
{{/description}}
2020
{{^description}}
2121
{{#deprecated}}
2222
/**
23-
*
24-
{{#deprecated}}
25-
* @deprecated
26-
{{/deprecated}}
27-
*/
23+
* @deprecated
24+
*/
2825
{{/deprecated}}
2926
{{/description}}
3027
'{{baseName}}'{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isNullable}} | null{{/isNullable}};

samples/client/echo_api/typescript-axios/build/api.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,16 @@ export interface Category {
3333
}
3434
export interface DataQuery extends Query {
3535
/**
36-
* test suffix
37-
*/
36+
* test suffix
37+
*/
3838
'suffix'?: string;
3939
/**
40-
* Some text containing white spaces
41-
*/
40+
* Some text containing white spaces
41+
*/
4242
'text'?: string;
4343
/**
44-
* A date
45-
*/
44+
* A date
45+
*/
4646
'date'?: string;
4747
}
4848

@@ -81,8 +81,8 @@ export interface Pet {
8181
'photoUrls': Array<string>;
8282
'tags'?: Array<Tag>;
8383
/**
84-
* pet status in the store
85-
*/
84+
* pet status in the store
85+
*/
8686
'status'?: PetStatusEnum;
8787
}
8888

@@ -96,8 +96,8 @@ export type PetStatusEnum = typeof PetStatusEnum[keyof typeof PetStatusEnum];
9696

9797
export interface Query {
9898
/**
99-
* Query
100-
*/
99+
* Query
100+
*/
101101
'id'?: number;
102102
'outcomes'?: Array<QueryOutcomesEnum>;
103103
}

samples/client/petstore/typescript-axios/builds/default/api.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ export interface Order {
4747
'quantity'?: number;
4848
'shipDate'?: string;
4949
/**
50-
* Order Status
51-
*/
50+
* Order Status
51+
*/
5252
'status'?: OrderStatusEnum;
5353
'complete'?: boolean;
5454
}
@@ -71,8 +71,8 @@ export interface Pet {
7171
'photoUrls': Array<string>;
7272
'tags'?: Array<Tag>;
7373
/**
74-
* pet status in the store
75-
*/
74+
* pet status in the store
75+
*/
7676
'status'?: PetStatusEnum;
7777
}
7878

@@ -103,8 +103,8 @@ export interface User {
103103
'password'?: string;
104104
'phone'?: string;
105105
/**
106-
* User Status
107-
*/
106+
* User Status
107+
*/
108108
'userStatus'?: number;
109109
}
110110

samples/client/petstore/typescript-axios/builds/es6-target/api.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ export interface Order {
4747
'quantity'?: number;
4848
'shipDate'?: string;
4949
/**
50-
* Order Status
51-
*/
50+
* Order Status
51+
*/
5252
'status'?: OrderStatusEnum;
5353
'complete'?: boolean;
5454
}
@@ -71,8 +71,8 @@ export interface Pet {
7171
'photoUrls': Array<string>;
7272
'tags'?: Array<Tag>;
7373
/**
74-
* pet status in the store
75-
*/
74+
* pet status in the store
75+
*/
7676
'status'?: PetStatusEnum;
7777
}
7878

@@ -103,8 +103,8 @@ export interface User {
103103
'password'?: string;
104104
'phone'?: string;
105105
/**
106-
* User Status
107-
*/
106+
* User Status
107+
*/
108108
'userStatus'?: number;
109109
}
110110

samples/client/petstore/typescript-axios/builds/test-petstore/api.ts

Lines changed: 30 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ export interface AdditionalPropertiesClass {
3131
'map_with_undeclared_properties_anytype_2'?: object;
3232
'map_with_undeclared_properties_anytype_3'?: { [key: string]: any; };
3333
/**
34-
* an object with no declared properties and no undeclared properties, hence it\'s an empty map.
35-
*/
34+
* an object with no declared properties and no undeclared properties, hence it\'s an empty map.
35+
*/
3636
'empty_map'?: object;
3737
'map_with_undeclared_properties_string'?: { [key: string]: string; };
3838
}
@@ -81,8 +81,8 @@ export interface Capitalization {
8181
'Capital_Snake'?: string;
8282
'SCA_ETH_Flow_Points'?: string;
8383
/**
84-
* Name of the pet
85-
*/
84+
* Name of the pet
85+
*/
8686
'ATT_NAME'?: string;
8787
}
8888
export interface Cat extends Animal {
@@ -236,12 +236,12 @@ export interface FormatTest {
236236
'uuid'?: string;
237237
'password': string;
238238
/**
239-
* A string that is a 10 digit number. Can have leading zeros.
240-
*/
239+
* A string that is a 10 digit number. Can have leading zeros.
240+
*/
241241
'pattern_with_digits'?: string;
242242
/**
243-
* A string starting with \'image_\' (case insensitive) and one to three digits following i.e. Image_01.
244-
*/
243+
* A string starting with \'image_\' (case insensitive) and one to three digits following i.e. Image_01.
244+
*/
245245
'pattern_with_digits_and_delimiter'?: string;
246246
}
247247
/**
@@ -331,8 +331,8 @@ export interface Model200Response {
331331
*/
332332
export interface ModelFile {
333333
/**
334-
* Test capitalization
335-
*/
334+
* Test capitalization
335+
*/
336336
'sourceURI'?: string;
337337
}
338338
/**
@@ -372,19 +372,16 @@ export interface NumberOnly {
372372
export interface ObjectWithDeprecatedFields {
373373
'uuid'?: string;
374374
/**
375-
*
376-
* @deprecated
377-
*/
375+
* @deprecated
376+
*/
378377
'id'?: number;
379378
/**
380-
*
381-
* @deprecated
382-
*/
379+
* @deprecated
380+
*/
383381
'deprecatedRef'?: DeprecatedObject;
384382
/**
385-
*
386-
* @deprecated
387-
*/
383+
* @deprecated
384+
*/
388385
'bars'?: Array<string>;
389386
}
390387
export interface Order {
@@ -393,8 +390,8 @@ export interface Order {
393390
'quantity'?: number;
394391
'shipDate'?: string;
395392
/**
396-
* Order Status
397-
*/
393+
* Order Status
394+
*/
398395
'status'?: OrderStatusEnum;
399396
'complete'?: boolean;
400397
}
@@ -461,8 +458,8 @@ export interface Pet {
461458
'photoUrls': Array<string>;
462459
'tags'?: Array<Tag>;
463460
/**
464-
* pet status in the store
465-
*/
461+
* pet status in the store
462+
*/
466463
'status'?: PetStatusEnum;
467464
}
468465

@@ -549,24 +546,24 @@ export interface User {
549546
'password'?: string;
550547
'phone'?: string;
551548
/**
552-
* User Status
553-
*/
549+
* User Status
550+
*/
554551
'userStatus'?: number;
555552
/**
556-
* test code generation for objects Value must be a map of strings to values. It cannot be the \'null\' value.
557-
*/
553+
* test code generation for objects Value must be a map of strings to values. It cannot be the \'null\' value.
554+
*/
558555
'objectWithNoDeclaredProps'?: object;
559556
/**
560-
* test code generation for nullable objects. Value must be a map of strings to values or the \'null\' value.
561-
*/
557+
* test code generation for nullable objects. Value must be a map of strings to values or the \'null\' value.
558+
*/
562559
'objectWithNoDeclaredPropsNullable'?: object | null;
563560
/**
564-
* 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
565-
*/
561+
* 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
562+
*/
566563
'anyTypeProp'?: any;
567564
/**
568-
* 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.
569-
*/
565+
* 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.
566+
*/
570567
'anyTypePropNullable'?: any | null;
571568
}
572569
export interface Whale {

samples/client/petstore/typescript-axios/builds/with-complex-headers/api.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ export interface Order {
5656
'quantity'?: number;
5757
'shipDate'?: string;
5858
/**
59-
* Order Status
60-
*/
59+
* Order Status
60+
*/
6161
'status'?: OrderStatusEnum;
6262
'complete'?: boolean;
6363
}
@@ -80,8 +80,8 @@ export interface Pet {
8080
'photoUrls': Array<string>;
8181
'tags'?: Array<Tag>;
8282
/**
83-
* pet status in the store
84-
*/
83+
* pet status in the store
84+
*/
8585
'status'?: PetStatusEnum;
8686
}
8787

@@ -112,8 +112,8 @@ export interface User {
112112
'password'?: string;
113113
'phone'?: string;
114114
/**
115-
* User Status
116-
*/
115+
* User Status
116+
*/
117117
'userStatus'?: number;
118118
}
119119

0 commit comments

Comments
 (0)