Skip to content

feat: Implement tuple discriminator detection for union optimization#5643

Open
mohankumarelec wants to merge 2 commits intocolinhacks:mainfrom
mohankumarelec:union-optimizer
Open

feat: Implement tuple discriminator detection for union optimization#5643
mohankumarelec wants to merge 2 commits intocolinhacks:mainfrom
mohankumarelec:union-optimizer

Conversation

@mohankumarelec
Copy link

Description

Optimizes union parsing performance by detecting tuple discriminators on the first element. Skips unnecessary validation attempts when the first tuple item is a literal that can discriminate between union branches.

Test plan

  • Added test with deeply nested recursive schema (1000-level nesting) to verify performance optimization works correctly

@pullfrog
Copy link
Contributor

pullfrog bot commented Jan 17, 2026

Pullfrog is configured to use Claude Code, but the associated API key was not provided.

To fix this, add the required secret to your GitHub repository:

  1. Go to: https://github.com/colinhacks/zod/settings/secrets/actions
  2. Click "New repository secret"
  3. Set the name to ANTHROPIC_API_KEY
  4. Set the value to your API key
  5. Click "Add secret"

Alternatively, configure Pullfrog to use a different agent at https://pullfrog.com/console/colinhacks/zod

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.

1 participant