Skip to content
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

feat: brings back --make-paths-enum option to generate ApiPaths enum #2052

Merged
merged 4 commits into from
Dec 29, 2024

Conversation

laurenz-glueck
Copy link
Contributor

@laurenz-glueck laurenz-glueck commented Dec 14, 2024

Changes

Brings back --make-paths-enum option to generate ApiPaths enum.
See: #1057

Checklist

  • Unit tests updated
  • docs/ updated (if necessary)
  • pnpm run update:examples run (only applicable for openapi-typescript)

Copy link

changeset-bot bot commented Dec 14, 2024

🦋 Changeset detected

Latest commit: e4ce821

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
openapi-typescript Minor
swr-openapi Major

Not sure what this means? Click here to learn what changesets are.

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

@laurenz-glueck laurenz-glueck marked this pull request as ready for review December 20, 2024 08:44
@laurenz-glueck laurenz-glueck requested a review from a team as a code owner December 20, 2024 08:44
@laurenz-glueck laurenz-glueck requested a review from gzm0 December 20, 2024 08:44
@gzm0
Copy link
Contributor

gzm0 commented Dec 20, 2024

@drwpow it seems you have some more context on this.

I suspect the discussion in the issue went missing because it was closed.

@drwpow
Copy link
Contributor

drwpow commented Dec 21, 2024

Sorry I think this was just an accidental omission for 7.x, but since it’s an opt-in feature flag I support adding it! (I’ll only try to ensure that default behavior doesn’t change).

I’m in favor of this merging, but we’ll need to add a few tests just to ensure this feature doesn’t break. Also please add a minor changeset for this feature so we can release it 🙏

@laurenz-glueck
Copy link
Contributor Author

@drwpow Sounds good!
Please give me a few days and I will try to add some tests and also the changeset…

Copy link

netlify bot commented Dec 27, 2024

👷 Deploy request for openapi-ts pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 4affc3c

@laurenz-glueck
Copy link
Contributor Author

@drwpow I have added a few tests and a minor changeset.
Please let me know what you think.

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 great, thank you! All tests pass and current behavior doesn’t change when the flag isn’t enabled. Will get this merged and shipped!


Enabling `--make-paths-enum` will add an `ApiPaths` enum like this to the generated types:

::: code-group
Copy link
Contributor

Choose a reason for hiding this comment

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

Great docs, thank you!

},
],
[
"basic with path parameter",
Copy link
Contributor

Choose a reason for hiding this comment

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

Great tests! 🎉

@drwpow drwpow merged commit d2de5c7 into openapi-ts:main Dec 29, 2024
8 checks passed
@openapi-ts-bot openapi-ts-bot mentioned this pull request Dec 29, 2024
@laurenz-glueck laurenz-glueck deleted the feat/makePathsEnum branch December 30, 2024 11:13
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