Skip to content

fix(Type): a union with a class that is no component is left untyped - #2304

Merged
DerManoMann merged 1 commit into
zircote:masterfrom
DerManoMann:fix/union-unknown
Oct 22, 2026
Merged

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

Conversation

@DerManoMann

Copy link
Copy Markdown
Collaborator

Overview

A union with a member that is a class without a schema, for example Thing|int, comes out as oneOf: [{type: integer}, {}]. {} matches any value, so an integer matches both members, and oneOf then rejects it. The union now gets no type, as a property typed with the class alone does.

Changes

  • A union with a member that is a class without a schema is left untyped, in classic, hybrid and spec
  • Hybrid and spec still warn that the class has no schema
  • A union of schemas and native types, for example a component and int, keeps its oneOf

`Types` and `TypeInfoTypeResolver` leave out the `oneOf` of a union when one of
its members is a class that is no component, as they do for a property typed
with that class alone. A union of components and native types keeps its
`oneOf`. The `ClassRef` scratch fixture gains both kinds of union.
@DerManoMann
DerManoMann merged commit 2958a0a into zircote:master Oct 22, 2026
19 checks passed
@DerManoMann
DerManoMann deleted the fix/union-unknown branch October 22, 2026 04:16
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