-
-
Notifications
You must be signed in to change notification settings - Fork 469
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 type discrimination for non-overlapping content types #1610
Conversation
🦋 Changeset detectedLatest commit: 7f75fa9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
This is great, thank you! If you could fix the linting error, and add a |
Hi @illright. Does this also fix the issue where both data and result can not infer correctly to their respective types after an if check? const dataRes = await GET('/');
if (dataRes.data !== undefined) {
// dataRes.data is never
console.log(dataRes.data);
} |
@JrSchild hard to say, I would need to see your openapi schema as well. Feel free to check out this branch and try it out for yourself |
@drwpow is it ready to go? |
Ah thanks for the poke! Looks great and will merge; CI tests are currently experiencing an issue that I’ll fix this week. |
Released in the latest version of |
Changes
Fixes #1609
How to Review
I've added a new kind of test — Vitest type test, to verify the correctness of this solution.
Checklist
docs/
updated (if necessary)pnpm run update:examples
run (only applicable for openapi-typescript)