-
-
Notifications
You must be signed in to change notification settings - Fork 272
fix: handle discriminator could be extending it #2515
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
fix: handle discriminator could be extending it #2515
Conversation
|
|
🦋 Changeset detectedLatest commit: b81051e 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 |
|
@malcolm-kee is attempting to deploy a commit to the Hey API Team on Vercel. A member of the Team first needs to authorize it. |
3c1dfd1 to
f0834c8
Compare
commit: |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2515 +/- ##
==========================================
- Coverage 24.46% 24.45% -0.01%
==========================================
Files 344 344
Lines 34109 34120 +11
Branches 1496 1496
==========================================
Hits 8345 8345
- Misses 25754 25765 +11
Partials 10 10
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:
|
mrlubos
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love your pull requests, so clean! Thanks again!
Currently the code assumes when a schema X has a
allOfreference to another schema Y withdiscriminator, then schema X should respects thatdiscriminatorand add thediscriminator.typewith value set to the schema name of X (if there is no `discriminator.mapping refer to schema X).However, schema X could also be extending schema Y, and in that case it should not add the
discriminator.typeproperty.See first commit for the bug reproduction. It is causing
QuxExtendtype to becomesnever.See second commit for the fix. The assumption is if schema Y has
oneOfandoneOfdoesn't include schema X, then X is extending Y so it should not adddiscriminator.typeto itself.