Skip to content

feat: introduce excludeDeprecated option #1111

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 16, 2023

Conversation

benevbright
Copy link
Contributor

@benevbright benevbright commented May 13, 2023

Changes

Often time we want to exclude deprecated fields completely from generated types so we can spot deprecated fields asap.
Unfortunately, TS doesn't have a such option: microsoft/TypeScript#49433
The code editor shows deprecated fields with scratched out, which is nice but not enough.

For example, you created a new version of SDK, then you wish TS would complain about use of deprecated fields asap but it doesn't.

How to Review

It should be straight forward to review but I'm not sure if I should add this option on every single getEntries usages.

Checklist

  • Unit tests updated
  • README updated
  • examples/ directory updated (if applicable)

@changeset-bot
Copy link

changeset-bot bot commented May 13, 2023

⚠️ No Changeset found

Latest commit: b03036d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

@drwpow drwpow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a cool idea, thank you! I’m in favor of merging this as this seems useful and spiritually-aligned with the deprecated property. No feedback on the PR—everything looks well-considered and reasonable. Great tests, flag addition, everything 🎉

@benevbright
Copy link
Contributor Author

@drwpow super! thanks! 👍

I just added README as well. (could you approve again?)

@benevbright benevbright requested a review from drwpow May 14, 2023 07:38
Copy link
Contributor

@mitchell-merry mitchell-merry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

love it

@mitchell-merry mitchell-merry merged commit dfe8cc4 into openapi-ts:main May 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants