Skip to content

chore: update comment in v2 schema merging - #2573

Merged
mromaszewicz merged 1 commit into
oapi-codegen:mainfrom
mromaszewicz:chore/v2-merge-comment
Sep 24, 2026
Merged

mromaszewicz merged 1 commit into
oapi-codegen:mainfrom
mromaszewicz:chore/v2-merge-comment

Conversation

@mromaszewicz

Copy link
Copy Markdown
Member

Follow-up to #2571, comments only.

A review of #2571 asked why a nested allOf member that is the only source of named properties still loses them. That is deliberate: v2 generates such a merge as a map (or a union), and adding a property would turn it into a struct, breaking code that uses the map. The comment on addNestedOwnPropertiesV2 and the test covering the case (TestNestedOwnPropertiesV2KeepsTypeKinds) now say so, and that schema-merging-behavior: v3 keeps those properties.

No code or generated output changes.

🤖 Generated with Claude Code

A review of oapi-codegen#2571 asked why a nested allOf member that is the only
source of named properties still loses them. It is deliberate: v2
generates such a merge as a map (or a union), and adding a property
would turn it into a struct, breaking code that uses the map. The
comment on addNestedOwnPropertiesV2 and the test that covers the case
now say so, and that schema-merging-behavior v3 keeps them.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@mromaszewicz
mromaszewicz requested a review from a team as a code owner September 24, 2026 20:35
@greptile-apps

greptile-apps Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

The PR appears safe to merge.

Summary

This PR clarifies why v2 deliberately leaves nested properties out of propertyless merges and notes that v3 retains them. It changes comments only; generated behavior and test assertions are unchanged.

Reviews (1) · Last reviewed commit: "chore: update comment in v2 schema mergi..."

@mromaszewicz
mromaszewicz merged commit 03ba303 into oapi-codegen:main Sep 24, 2026
15 checks passed
@mromaszewicz
mromaszewicz deleted the chore/v2-merge-comment branch September 26, 2026 00:46
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