Skip to content

fix: disambiguate colliding schema type names - #53

Merged
lightsofapollo merged 1 commit into
mainfrom
fix/schema-name-collisions
Aug 7, 2026
Merged

fix: disambiguate colliding schema type names#53
lightsofapollo merged 1 commit into
mainfrom
fix/schema-name-collisions

Conversation

@lightsofapollo

@lightsofapollo lightsofapollo commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Closes #52

Summary

  • detect component and generated-inline schema names that normalize to the same Rust model identifier
  • preserve an exact canonical component name when present and suffix later collisions deterministically (SessionStatus2, etc.)
  • rewrite local $ref, discriminator, dependency, pattern, operation, response, and query-type references to the disambiguated name
  • remove the previous silent first-schema-wins behavior
  • cover the reported SessionStatus / session.status reproduction

Validation

  • cargo test --test schema_name_collision_test
  • cargo test --all-features
  • cargo clippy --all-features -- -D warnings
  • cargo fmt -- --check
  • git diff --check
  • parse-only generation for all 10 corpus specs that exposed existing collisions in the initial CI run: Box, CircleCI, Cloudflare, Gcore, GitHub, Grafana, Increase, Lithic, Stripe, and Telnyx

@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 3:55pm

Request Review

@lightsofapollo
lightsofapollo force-pushed the fix/schema-name-collisions branch from 35694da to 8dae7a7 Compare August 7, 2026 15:55
@lightsofapollo lightsofapollo changed the title fix: reject colliding schema type names fix: disambiguate colliding schema type names Aug 7, 2026
@lightsofapollo
lightsofapollo merged commit 7715cb5 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]: Two component schemas whose keys differ but has same PascalCase name can cause a naming collision

1 participant