-
-
Notifications
You must be signed in to change notification settings - Fork 272
fix(sdk): nested operationIds and tags. Add tests for nested class generation #2426
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
Conversation
|
|
🦋 Changeset detectedLatest commit: 7308d9b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
@flow96 is attempting to deploy a commit to the Hey API Team on Vercel. A member of the Team first needs to authorize it. |
e5fc1e9 to
5a9b6f6
Compare
5a9b6f6 to
c78c2ca
Compare
commit: |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2426 +/- ##
==========================================
- Coverage 22.77% 22.77% -0.01%
==========================================
Files 334 334
Lines 32941 32946 +5
Branches 1302 1302
==========================================
Hits 7502 7502
- Misses 25430 25435 +5
Partials 9 9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Fixes #2377
This bug only occures when
asClasswas set totrueand when the schema contains the same nested tags and operationIds. For example:Based on that schema the implementation tries to build a paths like this:
providers.providers.domains.getanddomains.providers.domains.get(the tags are used for the root class and then the path is built up from the operationId).The problem that occurs, is that the generator tries add the same class multiple times and then link these two or more instances with each other, which ends up in an endless recursion loop.
I fixed it by removing the root class from the path if the same class name appears later in that path already. So for our example the new path would be:
providers.domains.getI added two tests to verify the class generation works with nested classes - with and without instance creation.