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
Only allow AliasNode as a structural reference #1026
Currently, the rules about where aliases (for cyclic types) can occur are not strict enough, leading to confusing structures where you don't know when you're going to get an alias or a resolved node.
Now that the ID is calculated before the node itself is created, this could be used to ensure we can resolve to that reference ahead of time and only in structural positions, i.e. on a Sequence/Required/Optional/Index node.
Other changes I'd like to make alongside this one:
A layer above type/schema called node that would not accept parsed definitions but only what is now Inner and reduce it to a node.
This would be not be top-level callable, therefore we could construct nodes and stitch them together by referring cycles back to an object that is currently being constructed
Would be scopeless, simplifying caching
Would be wrapped by type/schema with scopes, which would make boundaries for .finalize explicit
UPDATE: I'm mitigating the mentioned related issues by simply not discriminating discriminated types for now. Part of this change should to re-introduce discrimination for cyclic types.
Activity
fix(schema): allow an alias only as a structural value
test(type): expect object.json's discriminated message in testSchemaF…
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.