-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve introspection of types #36
Comments
It's absolutely possible to change things so that those things are stored in the schema object (like how dictionary internally stores things). Have you put any thought into what a good standardised way of doing this might be? There's a somewhat human-friendly For specific schema types like either and choices, I'll look at adding pertinent info to the schema so it can be accessed when generating documentation. |
So far, I'm using the For example, I use a #let url(assertions: (), ..args) = string(
name: "url",
assertions: (
assert.matches(
regex("..."), // regex to match URLs
),
..assertions,
),
..args,
) My visualization does not know, that I think in 0.2.0 the only type not doing this is |
I think perhaps the solution is to provide another field called #let url(assertions: (), ..args) = string(
description: "url",
assertions: (
assert.matches(
regex("..."), // regex to match URLs
),
..assertions,
),
..args,
) would have |
Sure, that would work. |
I'm in the process of implementing a basic visualization of valkyrie schemas for my documentation template (like suggested in #17). It won't cover every possible case, but can be used as a means to define custom datatypes.
Some of the provided types don't expose all necessary information for this, though. For example
#choice(list)
"hides" the list of possible choices in an assertion closure.It would be nice if types made all important information available (like in the example above in a
choices
key).Some types do that (eg
#either
has an extraoptions
key), but not all.The text was updated successfully, but these errors were encountered: