Skip to content

fix: allow nested discriminated unions as they are supported in Zod v4#367

Merged
AGalabov merged 1 commit into
asteasolutions:masterfrom
dirkluijk:support-discriminated-unions
Mar 20, 2026
Merged

fix: allow nested discriminated unions as they are supported in Zod v4#367
AGalabov merged 1 commit into
asteasolutions:masterfrom
dirkluijk:support-discriminated-unions

Conversation

@dirkluijk

@dirkluijk dirkluijk commented Mar 6, 2026

Copy link
Copy Markdown
Contributor

Fixed #239.

I marked it as a fix rather than a feature, as I would consider this expected behavior with Zod v4, also didn't have to add additional logic other than removing an error message 🎉

@dirkluijk dirkluijk changed the title fix: allow discriminated unions as they are supported in Zod v4 fix: allow nested discriminated unions as they are supported in Zod v4 Mar 6, 2026
@dirkluijk
dirkluijk force-pushed the support-discriminated-unions branch from 45f8650 to a7ce3d0 Compare March 6, 2026 11:20
@dirkluijk

dirkluijk commented Mar 9, 2026

Copy link
Copy Markdown
Contributor Author

Any chance to get this merged? It blocks me to migrate a specific project to @asteasolutions/zod-to-openapi :)

@AGalabov

@AGalabov

Copy link
Copy Markdown
Member

@dirkluijk sorry it took me so long to get to this. I think the PR looks good. However the pipeline tests are failing - please run the lint (i.e it is justp prettier) command

@dirkluijk
dirkluijk force-pushed the support-discriminated-unions branch from a7ce3d0 to 2318125 Compare March 20, 2026 14:56
@dirkluijk

Copy link
Copy Markdown
Contributor Author

You’re welcome, no problem at all. I felt a bit hesitant to tag you earlier.

I’ve fixed the lint issue!

@AGalabov
AGalabov merged commit edf336e into asteasolutions:master Mar 20, 2026
3 checks passed
@AGalabov

Copy link
Copy Markdown
Member

@dirkluijk thank you once again
This should be available as a new 8.5.0 version now

@dirkluijk

Copy link
Copy Markdown
Contributor Author

Awesome!!

@dirkluijk

Copy link
Copy Markdown
Contributor Author

@AGalabov sorry, I made a mistake in this PR. 🥹

I prepared a fix for it in #369.

@dirkluijk
dirkluijk deleted the support-discriminated-unions branch March 23, 2026 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nested discriminated unions

2 participants