On Tue, Aug 2, 2011 at 10:16, Ken Barber <[email protected]> wrote: >>> You could in theory transfer kwalify-like specification to the >>> language ... here is a quick hack for discussion: >>> >>> class bind ( >>> $options => { >> >> I imagined it being in the body, and calling a method, until we added >> syntax, but either way would work. Mostly, I figure any solution lets >> us figure out how well Kwalify is a match for our real-world needs. > > Good points. This is a very non-intrusive way of experimenting with > kwalify I think. In that case we can drop the use of a file and have > the validate_resource() function take a kwalify schema (in the form of > a puppet hash) as a parameter. > >> Hrm. Possibly using an explicitly scoped variable beside the class >> declaration might be a way to get this into the language without so >> much impedence mismatch in where you land the data? >> >> $example::nested::class::options = {...} >> class example::nested::class { ... } > > Yeah - its important to make the schema available via REST from an > external ENC or hiera store editor ... if the data is not in a > known/obvious place that can be tapped from say an indirector of some > kind we lose some of the magic.
I wonder if that is an immediate need, or if it could wait until we started to merge this into the language proper? I guess, what I miss right here is that while those are valuable uses of the data, they don't seem to me on the critical path of testing Kwalify in the real world and finding out how it works... > At the moment I've hacked on Luke's work with the resource_type API > which seemed like the most viable place to have the schema displayed. > I'm struggling to think of a way to extend this without changing core. This is the heart of why I look at it, and think that testing outside the path of exposing the data would be good. Not for the long term, just for right now, so we don't over-invest in data access before we solve the problem of data format and integration. API-wise, I would hope we could export the validation data in the same place that we export the other class data (eg: not just that a parameter exists, but type data for it) too. daniel -- ⎋ Puppet Labs Developer – http://puppetlabs.com ♲ Made with 100 percent post-consumer electrons -- You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.
