Skip to content

Fix bug in merging schemas with default values - #1380

Closed
podhmo wants to merge 2 commits into
oapi-codegen:mainfrom
podhmo:fix-1379
Closed

podhmo wants to merge 2 commits into
oapi-codegen:mainfrom
podhmo:fix-1379

Conversation

@podhmo

@podhmo podhmo commented Dec 8, 2023

Copy link
Copy Markdown

@jamietanna

Copy link
Copy Markdown
Member

Via it looks like we'll also need a kin-openapi bump?

@podhmo

podhmo commented Dec 13, 2023 •

Copy link
Copy Markdown
Author

#1380 (comment)

Yes, a bumped version is required after the kin-open API is updated to fully fix the bug.

That said, this PR merge and bump kin-openapi can be separated as tasks.

  • this PR fixes in codegen phase
  • the bump fixes in runtime phase ( but newer version is not released yet)

@podhmo

podhmo commented Oct 4, 2024

Copy link
Copy Markdown
Author

kin-openapi is already updated

@va4st

va4st commented Sep 18, 2026

Copy link
Copy Markdown

@jamietanna @mromaszewicz Folks, could you please take a look

@mromaszewicz

Copy link
Copy Markdown
Member

Thank you for the fix and the tests, @podhmo, and for your patience; this waited far too long.

#1379 has now been fixed as part of the allOf/anyOf/oneOf rework in #2562, which changed schema merging so that a default on only one side of an allOf is carried over rather than rejected. That rework replaced the code this PR patches, so it can no longer be applied as it is.

Since the issue is resolved, I am closing this PR. If you still hit "merging two sets of defaults is undefined" in a case that should work, please open an issue with the spec.


This message was drafted with AI assistance (Claude) and reviewed by a maintainer.

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.

"merging two sets of defaults is undefined" is occured when allOf with default value

4 participants