}
});
}
=head1 CLIENT-SIDE VALIDATION
This recipe describes how to generate JSON objects which can be used to validate
user input in the web-browser (client-side).
=head2 Proble
uration available as JSON objects in the browser.
=head2 Solution
Using introspection, you can leverage the prototype class associated with your
validation class to generate JSON objects based on yo
./generate_jsapi > app.api.js
use MyApp::Introspect;
use JSON;
my $classes = {};
my $json = JSON->new->allow_blessed->convert_blessed->pretty([1]);
my $intros
ields) = each(%{$classes})) {
$namespace =~ s/::/./;
my $objects = $json->encode($fields);
chomp $objects;
print "$namespace = $objects;