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
I want to validate a recursive schema (an item list where each item can itself be an item list).
Instead of creating a //recursive type, I propose a //lazy type:
The problems you're solving are things worth solving, but I don't like this solution. It requires that the user know the order in which things are loaded: they need to make things lazy only if (for example) the thing they depend on is not yet loaded.
Here is my counter-suggestion: add a means to pre-declare a namespace, promising that it will be added later.
Now you can use that type, and it will become a placeholder for later inflation. Nothing needs to know about it. Further, you could make learn_type automatically predeclare the name of the type being learned when they are configured, so recursion works without any extra work.
Hi,
I have a suggestion for a new coretype.
I want to validate a recursive schema (an item list where each item can itself be an item list).
Instead of creating a
//recursive
type, I propose a//lazy
type:Example if we define a new
/example/itemlist
type (a list of elements, that are either string or itemlist):The
//lazy
type should not be resolved during the schema construction, but at validation time.Implementation example in python:
More than recursive schema, it allows to use a schema that will be later defined (in case of circular inclusion)
The text was updated successfully, but these errors were encountered: