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 suspect it is not possible, but I have to check: I want to use Konform with HTML DSL and generate HTML form validation information (required, minlength etc). But to do that I would need some kind of introspection of which validations is applied to an Validation/Object.
Is it possible? It would make it really useful in combination with other things. 😃
Found this so suspect it's not possible, but honestly not that intimate with deep Kotlin details: #27
The text was updated successfully, but these errors were encountered:
this isn't really possible for the reasons outlined in the issue you linked. Konform has the validation logic as code, not in a way that could be used the generate minlenght="..." etc. Changing this to something that is declarative and could be used to generate HTML forms, JSON schema et.c is way out of scope.
You could do something like this yourself and convert it into both konform and html form validation:
data classHtmlFormAndKonformValidation(
valminlength:Int? = null// ..
) {
privateval me get() =thisfuntoHtmlFormValidation() =// ...val konform =Validation<String> {
if(me.minlength !=null) minlength(me.minlength)
}
}
data classMyThing(valfoo:String)
val myThingFooValidation =HtmlFormAndKonformValidation(minlenght =5)
val myThingKonformValidation =Validation<MyThing> {
MyThing::foo { run(myThingFooValidation.konform) }
}
I suspect it is not possible, but I have to check: I want to use Konform with HTML DSL and generate HTML form validation information (required, minlength etc). But to do that I would need some kind of introspection of which validations is applied to an Validation/Object.
Is it possible? It would make it really useful in combination with other things. 😃
Found this so suspect it's not possible, but honestly not that intimate with deep Kotlin details: #27
The text was updated successfully, but these errors were encountered: