Skip to content

Preserve typed property when allOf branches overlap#84

Merged
cubahno merged 2 commits into
mainfrom
ig/fix-allof-merge
May 18, 2026
Merged

Preserve typed property when allOf branches overlap#84
cubahno merged 2 commits into
mainfrom
ig/fix-allof-merge

Conversation

@cubahno

@cubahno cubahno commented May 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • mergeOpenapiSchemas overwrote properties shared by two allOf branches with whatever the second branch declared, even when that branch only carried an annotation (e.g. example) and no type. The typed side - including its enum/constraints - was silently lost and the field collapsed to struct{} in generated code.
  • When a property exists on both sides, keep the typed declaration and only let an untyped override win when the existing entry is also untyped. The original SchemaProxyis preserved so downstream GoLow().GetReference() attribution still works.

@cubahno cubahno marked this pull request as ready for review May 18, 2026 21:35
@cubahno cubahno marked this pull request as draft May 18, 2026 21:45
@cubahno cubahno force-pushed the ig/fix-allof-merge branch from e7594fa to 02e1c29 Compare May 18, 2026 22:04
@cubahno cubahno marked this pull request as ready for review May 18, 2026 22:06
@cubahno cubahno merged commit c29d918 into main May 18, 2026
3 checks passed
@cubahno cubahno deleted the ig/fix-allof-merge branch May 18, 2026 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant