-
-
Notifications
You must be signed in to change notification settings - Fork 211
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
base: main
Are you sure you want to change the base?
Conversation
|
|
@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 32944 +3
Branches 1302 1302
==========================================
Hits 7502 7502
- Misses 25430 25433 +3
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
asClass
was set totrue
and 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.get
anddomains.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.get
I added two tests to verify the class generation works with nested classes - with and without instance creation.