In a multi-tenant system, perhaps you should force users to prefix specs with a namespace they own?
On Fri, Jun 17, 2016 at 1:46 PM, Brian Platz <brian.platz@place.works> wrote: > > I'd like to be able to use clojure.spec for input validation where the > specs are stored in a database using a data structure to represent them. > > s/keys and its requirement to use the registry makes this challenging. > > I'm able to generate specs dynamically using a workaround like: > (eval (cons 's/and <predicates>)) > > However, I don't see a way of utilizing s/keys in this manner, as the > keys must first be placed in the registry. > > I could register each key also using eval and s/def similarly to my > example above, however that would eliminate this method's use in a > multi-tenant environment where one client/instance may have a different > spec than another. > > The following ideas could make this much simpler: > - Allow s/keys to accept a spec to use with each key (i.e. the same > format used by s/or). > - Allow a *spec-registry* binding, enabling the use of multiple registries > > Any other ideas or anything I've missed that would make this use case more > feasible? > > > > > > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- “One of the main causes of the fall of the Roman Empire was that–lacking zero–they had no way to indicate successful termination of their C programs.” (Robert Firth) -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.