These are chat archives for dry-rb/chat

14th
Dec 2015
Lorenzo Arribas
@larribas
Dec 14 2015 10:02
@solnic Good to know, thanks!

I'm curious to know what do you think of another feature (that promises to be more challenging). I have a tree of nodes (represented as a hash). Each node has some validation constraints, and a "children" key which is an array of descendants.

Currently, I am validating each node separately and traversing the tree via a recursive function, but do you think it would be fitting if one could define a recursive validation right from the schema? Or perhaps it is too awkward?

Piotr Solnica
@solnic
Dec 14 2015 13:47
@larribas I want dry-v to support even awkward use cases as that is one of the reasons why it was created
Could you provide a gist presenting your usecase?
Lorenzo Arribas
@larribas
Dec 14 2015 17:10
Piotr Solnica
@solnic
Dec 14 2015 17:16
@larribas one thing I plan to add is to be able to treat a schema as a rule
so, theoretically you’d be able to apply schema recursively
this would be an interesting use case
it would also help in re-using schemas
Lorenzo Arribas
@larribas
Dec 14 2015 17:20
reusing schemas would be a great addition
but even so, referencing the same schema from inside of it may require some kind of lazy evaluation or delayed const_get-ish thing, right?
Piotr Solnica
@solnic
Dec 14 2015 17:22
@larribas nah, it would just require some additional interface to specify “validate with self"
as in apply all rules from self
API ideas most welcome :)
Andy Holland
@AMHOL
Dec 14 2015 17:23
I always love self
:p
Lorenzo Arribas
@larribas
Dec 14 2015 17:23
:P