[typescript-angular] Add support for marking model properties with @deprecated (#18417)

* [typescript-angular] Add support for marking model properties with @deprecated

* Add generated samples

* Only add comment if description or deprecated is set. And split description/deprecated on two lines if both are set.

* Update samples with generated output

* Fix indention

* Update samples

* Remove whitespace

* Update samples
This commit is contained in:
Even André Fiskvik 2024-04-22 15:24:24 +02:00 committed by GitHub
parent a724c754bc
commit 99b5fe9f9c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 16 additions and 1 deletions

View File

@ -2,9 +2,17 @@ export interface {{classname}}{{#allParents}}{{#-first}} extends {{/-first}}{{{.
{{#vars}}
{{#description}}
/**
* {{{.}}}
* {{{description}}}
{{#deprecated}}
* @deprecated
{{/deprecated}}
*/
{{/description}}
{{^description}}
{{#deprecated}}
/** @deprecated */
{{/deprecated}}
{{/description}}
{{#isReadOnly}}readonly {{/isReadOnly}}{{{name}}}{{^required}}?{{/required}}: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{#isNullable}} | null{{/isNullable}};
{{/vars}}
}{{>modelGenericEnums}}

View File

@ -24,6 +24,7 @@ export interface Pet {
tags?: Array<Tag>;
/**
* pet status in the store
* @deprecated
*/
status?: Pet.StatusEnum;
}

View File

@ -24,6 +24,7 @@ export interface Pet {
tags?: Array<Tag>;
/**
* pet status in the store
* @deprecated
*/
status?: Pet.StatusEnum;
}

View File

@ -24,6 +24,7 @@ export interface Pet {
tags?: Array<Tag>;
/**
* pet status in the store
* @deprecated
*/
status?: Pet.StatusEnum;
}

View File

@ -24,6 +24,7 @@ export interface Pet {
tags?: Array<Tag>;
/**
* pet status in the store
* @deprecated
*/
status?: Pet.StatusEnum;
}

View File

@ -24,6 +24,7 @@ export interface Pet {
tags?: Array<Tag>;
/**
* pet status in the store
* @deprecated
*/
status?: Pet.StatusEnum;
}

View File

@ -24,6 +24,7 @@ export interface Pet {
tags?: Array<Tag>;
/**
* pet status in the store
* @deprecated
*/
status?: Pet.StatusEnum;
}

View File

@ -24,6 +24,7 @@ export interface Pet {
tags?: Array<Tag>;
/**
* pet status in the store
* @deprecated
*/
status?: Pet.StatusEnum;
}