Skip to content

Enum with Root Types Filtering Recursive Reference #2375

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ParkerVR
Copy link

@ParkerVR ParkerVR commented Jul 14, 2025

Changes

Using the --enum and --root-types in combination causes recursive reference to enum types used in schemas, breaking the file.
A few issues related:

#2099
#2341

How to Review

A specific combination of flags causes recursive imports, marked as patch since it seems incredibly unlikely anyone could successfully use this output in a production system. Had a custom in my project and was trying to use the flags instead, but the combined behavior broke me. https://github.com/Equal-IQ/api-model/blob/e99585b6244ac814ea1044f62333474a5857c3b8/Containers/generate.js

Checklist

  • Unit tests updated (CJS Test is broken before and after my change, unrelated)
  • [] docs/ updated (if necessary) don't think any change is required, as this is a reasonable expected behavior
  • [] pnpm run update:examples run (only applicable for openapi-typescript) no changes required to these, since the combination is not used for them

@ParkerVR ParkerVR requested a review from a team as a code owner July 14, 2025 08:40
@ParkerVR ParkerVR requested a review from drwpow July 14, 2025 08:40
Copy link

netlify bot commented Jul 14, 2025

👷 Deploy request for openapi-ts pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 3fabebe

Copy link

changeset-bot bot commented Jul 14, 2025

🦋 Changeset detected

Latest commit: 3fabebe

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 Patch
swr-openapi Patch

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

ParkerVR added a commit to Equal-IQ/api-model that referenced this pull request Jul 14, 2025
@ParkerVR
Copy link
Author

I added some snapshot tests here since this change is a bit particular to CLI Flag Combination, though I guess it could be inlined instead like some of the other partial api spec examples. I'll leave it to maintainers to decide on that

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.

1 participant