Skip to content

fix(Augmenter): report an unmatched union member as omitting the whole union - #2447

Merged
DerManoMann merged 1 commit into
zircote:masterfrom
DerManoMann:fix/union-members
Nov 24, 2026
Merged

DerManoMann merged 1 commit into
zircote:masterfrom
DerManoMann:fix/union-members

Conversation

@DerManoMann

Copy link
Copy Markdown
Collaborator

Overview

A union such as int|Money, where Money matches no schema, loses its whole oneOf, int with it. The schema is right to leave it out, since a member that matches anything makes the union match anything. The message is not: it says only that Money was omitted.

Changes

  • An unmatched union member is reported as omitted with the rest of its union
  • The union's members are built only when every member matches
  • "Changed output in 7.11" in the v7 migration guide

Name each class in a union that matches no schema, or several, as omitted
with the rest of its union, and build the members only when all match.
`logUnmatchedClass()` carries the message for both cases.
@DerManoMann
DerManoMann merged commit 8d43c9a into zircote:master Nov 24, 2026
25 checks passed
@DerManoMann
DerManoMann deleted the fix/union-members branch November 24, 2026 22:47
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