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

fix(types): indicate that Schema.prototype.discriminator() returns this #12522

Merged
merged 1 commit into from Oct 5, 2022

Conversation

vkarpov15
Copy link
Collaborator

Fix #12457

Summary

#12457 pointed out that our types are slightly incorrect: Schema.prototype.discriminator() returns this, not the discriminated schema. Needed to change some tests which relied on the incorrect behavior. In cases like this where the TS types and runtime behavior disagree, we should assume the runtime behavior is more correct and fix the types, including any incorrect typing tests.

Examples

Copy link
Collaborator

@hasezoey hasezoey left a comment

Choose a reason for hiding this comment

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

LGTM

@hasezoey hasezoey added the typescript Types or Types-test related issue / Pull Request label Oct 5, 2022
@vkarpov15 vkarpov15 merged commit 2b5c79e into master Oct 5, 2022
@vkarpov15 vkarpov15 deleted the vkarpov15/gh-12457 branch October 5, 2022 15:04
@hasezoey hasezoey added this to the 6.6.5 milestone Oct 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
typescript Types or Types-test related issue / Pull Request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Return-Types for Schema.prototype.discriminator do not align with runtime behavior
2 participants