Skip to content

fix: reject ambiguous implicit discriminators - #55

Merged
lightsofapollo merged 1 commit into
mainfrom
fix/opencode-discriminator-collisions
Aug 7, 2026
Merged

fix: reject ambiguous implicit discriminators#55
lightsofapollo merged 1 commit into
mainfrom
fix/opencode-discriminator-collisions

Conversation

@lightsofapollo

Copy link
Copy Markdown
Contributor

Summary

  • require inferred discriminator values to be unique across every union branch
  • fall back to an untagged union when repeated values would create duplicate Serde tags
  • add the live OpenCode OpenAPI document to the generation and compile corpus
  • add regression coverage for ambiguous and unique inferred discriminators

Validation

  • cargo test --all-features
  • cargo clippy --all-features -- -D warnings
  • cargo fmt -- --check
  • SPEC_COMPILE_PARSE_ONLY=1 scripts/spec-compile.sh
  • SPEC_COMPILE_KEEP=1 scripts/spec-compile.sh opencode
  • generated OpenCode GlobalEvent runtime round-trip for a nested sync event

Closes #54

@vercel

vercel Bot commented Aug 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
openapi-to-rust Ready Ready Preview Aug 7, 2026 5:59pm

Request Review

@lightsofapollo
lightsofapollo merged commit d83f526 into main Aug 7, 2026
12 checks passed
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.

[bug]: Auto discriminator detect can pick up a field that has same value on every branch

1 participant