OpenAPITools / OpenAPITools/openapi-generator

[REQ][typescript] Mark entries as deprecated if property is present in swagger-definition

Open
#15,470 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature
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.

If a property or request is marked as deprecated in swagger, it has no effect on the generated typescript. Since typescript itself doesn't have any sense for deprecation, it would be best to add it using js-doc, which can be picked up by eslint rules if wanted.

https://stackoverflow.com/questions/60755711/is-it-possible-to-mark-something-as-deprecated-in-typescript

Describe the solution you'd like

Add a js-doc annotation to the properties of the generated types and functions for deprecated routes.

Describe alternatives you've considered

By not using any type of deprecation notice to consumers of an API is unwanted and might lead to unwanted side-effects if this property or route is removed at a later stage.

Additional context

..

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the TypeScript generator's handling of generated properties and route functions, then trace how the Swagger/OpenAPI deprecated property is represented. Done means generated TypeScript properties and functions for deprecated routes include JSDoc deprecation annotations.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, typescript
Domain
api, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.