You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[bug] inconsistent errors for unions with cyclesΒ #1630
In this example, I am not validating any Groups. I'm validating a single Field whose value is too short. I expect the issue.code to be minLength. This works as expected when Group does not have the parts: "Part[]" field.
When Group does have the parts: "Part[]" field, the error changes to issue.code="union". This seems wrong. I don't think it should change the behaviour.
I understand that technically because of the invalid constraint, this value is not a match for either Field or Group, and that's why it's reporting the potential choice. But given the discriminant is correct and the structure is correct, the likelihood of this being an invalid Group seems pretty much zero.
The practical impract of this is that I was developing a form with Tanstack Form which contains some unions and the validation errors don't get correct associated with the fields because of this issue.code="union" issue.
Activity
pullfrog commentedon Jun 19, 2026
fix(schema): finalize once no definition is open
fix(schema): allow an alias only as a structural value
fix(schema): dispatch interpreted unions on their discriminant
fix(schema): reference an open component's members by alias
fix(sets): key cyclic intersections canonically
fix(schema): instantiate recursive generics once per argument set
fix(schema): report a cyclic object reached outside an alias once
fix(schema): reduce a union's input or output once final
test(type): trim cyclic.test to one case per behavior
docs(type): cite the issues the release fixes and add the entries it β¦
ssalbdivad commentedon Nov 18, 2026
Fixed in 3.0.0-beta.0 (#1728). Try it with
npm i arktype@next.