Skip to content

fix(boat-engine): deduplicate structurally identical components/schemas entries - #1273

Merged
jjjasper merged 1 commit into
mainfrom
fix/devin-705-deduplicate-schemas
Aug 21, 2026
Merged

jjjasper merged 1 commit into
mainfrom
fix/devin-705-deduplicate-schemas

Conversation

@jjjasper

Copy link
Copy Markdown
Collaborator

Summary

  • Fixes DEVIN-705: boat:bundle/boat:generate could register the same external schema file under two different names when it's reachable both via its canonical component name and a direct $ref to the file, producing field-for-field identical models that show up as duplicate classes/doc pages downstream (e.g. duplicate model tabs on the developer portal).
  • Adds DeduplicateSchemasTransformer, wired in right after bundling, to merge such duplicates and rewrite every $ref pointing at the discarded duplicate to the canonical entry.
  • Breaking change for generated clients (Java/Angular-TS/Swift/Android-Kotlin): whichever duplicate name is dropped disappears from generated models. Documented in the README release notes.
  • Added a deduplicateSchemas plugin parameter (default true) on boat:bundle and boat:generate to opt out while consumers migrate.

Test plan

  • New unit tests DeduplicateSchemasTransformerTests (merge + ref rewrite, and no-op for distinct schemas) — boat-engine
  • New integration tests in BundleMojoTest against a new fixture (bundler/duplicate-schema) reproducing the ticket's scenario, covering both the default (dedup on) and opt-out (deduplicateSchemas=false) behavior
  • Full boat-engine test suite passes (33/33)
  • boat-maven-plugin's BundleMojoTest (17/17) and GeneratorTests (8/8) pass

Fixes DEVIN-705

🤖 Generated with Claude Code

…as entries (DEVIN-705)

Bundling can register the same external schema file under two different
names when it's reachable via both its canonical component name and a
direct $ref to the file, producing field-for-field identical models that
show up as duplicate classes/doc pages downstream (e.g. duplicate model
tabs on the developer portal).

Adds DeduplicateSchemasTransformer, wired into boat:bundle and boat:generate
right after bundling, to merge such duplicates and rewrite references to
the canonical entry. This is a breaking change for generated clients, so
it's documented in the README release notes and gated behind a new
deduplicateSchemas plugin parameter (default true) to opt out.

Co-Authored-By: Claude <[email protected]>
@sonarqubecloud

Copy link
Copy Markdown

@jjjasper
jjjasper requested a review from ankypant August 21, 2026 09:08
@jjjasper
jjjasper merged commit 7221664 into main Aug 21, 2026
6 of 8 checks passed
@jjjasper
jjjasper deleted the fix/devin-705-deduplicate-schemas branch September 3, 2026 14:01
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.

2 participants