OpenAPITools / OpenAPITools/openapi-generator
[REQ] [typescript-angular] Add deprecated tag to deprecated fields
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Is your feature request related to a problem? Please describe.
On operations a @deprecated tag is added (https://jsdoc.app/tags-deprecated.html) but on fields in an Angular model this is not the case. This is very annoying.
Describe the solution you'd like
The model.mustasche file in the typescript-angular library can be extended to add this functionality.
Describe alternatives you've considered
As a workaround the template can be edited manually using this approach: https://openapi-generator.tech/docs/templating/#custom-logic
But I believe this should be included in the default implementation.
Additional context
Desired output:
export interface Foo {
/**
* @deprecated
*/
test?: String;
}
From input:
name: Foo
deprecated: true
schema:
type: string
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the model.mustache file in the typescript-angular library and inspect how deprecated operations are rendered in the generated model output. Use the provided Foo input with a deprecated field to verify the generated interface includes the requested JSDoc tag; done means the default template produces that output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angular, typescript
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100