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: plain client method argument types for params with intersection types #2503

Merged
merged 2 commits into from
Jan 9, 2025

Conversation

andipaetzold
Copy link
Contributor

@andipaetzold andipaetzold commented Jan 3, 2025

Summary

Fix params arguments of some plain client methods

Description

The updated OptionalDefaults type introduced in #2491 causes issues for intersection types combined with union types.

image

This makes some plain client methods unusable

image

The issue is that the builtin Omit doesn't play well with intersections. This PR replaces that with a union-compatible Omit

@andipaetzold andipaetzold self-assigned this Jan 3, 2025
@andipaetzold andipaetzold marked this pull request as ready for review January 3, 2025 16:22
@andipaetzold andipaetzold requested a review from a team as a code owner January 3, 2025 16:22
@marcolink
Copy link
Member

@andipaetzold this annoyed me for a long time, thanks for fixing it :)

@andipaetzold andipaetzold enabled auto-merge (squash) January 9, 2025 09:44
@andipaetzold andipaetzold merged commit f32251e into master Jan 9, 2025
7 checks passed
@andipaetzold andipaetzold deleted the fix-OptionalDefaults branch January 9, 2025 09:54
@contentful-automation
Copy link
Contributor

🎉 This PR is included in version 11.40.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants