Group
Extension

Matches 6

JSON-Schema-Generator ( A/AE/AEREAL/JSON-Schema-Generator-0.01-TRIAL.tar.gz, AEREAL, 2015; MetaCPAN )
JSON-Schema-Generator/lib/JSON/Schema/Generator.pm ( view source; MetaCPAN )
ackage JSON::Schema::Generator;
use 5.008001;
use strict;
use warnings;

our $VERSION = "0.01";

use JSON::Schema::Generator::Handler::Array;
use JSON::Schema::Generator::Handler::Atom;
use JSON::Sche
ma::Generator::Handler::Maybe::Lifted;
use JSON::Schema::Generator::Handler::Object;
use JSON::Schema::Generator::Handler::Union;
use JSON::TypeInference;

sub new {
  my ($class) = @_;
  return bless
b generate {
  my ($self) = @_;
  my $inferred_type = JSON::TypeInference->infer($self->{learned_data});
  return {
    '$schema'   => 'http://json-schema.org/draft-04/schema#',
    title       => 'TO
JSON-Schema-Generator ( A/AE/AEREAL/JSON-Schema-Generator-0.01-TRIAL.tar.gz, AEREAL, 2015; MetaCPAN )
JSON-Schema-Generator/lib/JSON/Schema/Generator/Handler/Maybe/Lifted.pm ( view source; MetaCPAN )
package JSON::Schema::Generator::Handler::Maybe::Lifted;

use strict;
use warnings;

sub process {
  my($class, $maybe_type, $examples, $dispatch) = @_;
  my $entity_examples = [ grep { $maybe_type->t
JSON-Schema-Generator ( A/AE/AEREAL/JSON-Schema-Generator-0.01-TRIAL.tar.gz, AEREAL, 2015; MetaCPAN )
JSON-Schema-Generator/lib/JSON/Schema/Generator/Handler/Union.pm ( view source; MetaCPAN )
package JSON::Schema::Generator::Handler::Union;

use strict;
use warnings;

sub process {
  my ($class, $union_type, $examples, $dispatch) = @_;
  return +{
    type    => [ map { $_->name } @{$union
JSON-Schema-Generator ( A/AE/AEREAL/JSON-Schema-Generator-0.01-TRIAL.tar.gz, AEREAL, 2015; MetaCPAN )
JSON-Schema-Generator/lib/JSON/Schema/Generator/Handler/Atom.pm ( view source; MetaCPAN )
package JSON::Schema::Generator::Handler::Atom;

use strict;
use warnings;

sub process {
  my ($class, $atom_type, $examples, $dispatch) = @_;
  return +{
    type => $atom_type->name,
    ($atom_typ
e->isa('JSON::TypeInference::Type::Unknown') ? () : (example => $examples->[0])),
  };
}

1;
JSON-Schema-Generator ( A/AE/AEREAL/JSON-Schema-Generator-0.01-TRIAL.tar.gz, AEREAL, 2015; MetaCPAN )
JSON-Schema-Generator/lib/JSON/Schema/Generator/Handler/Object.pm ( view source; MetaCPAN )
package JSON::Schema::Generator::Handler::Object;

use strict;
use warnings;

use List::MoreUtils qw(uniq);

sub process {
  my ($class, $object_type, $examples, $dispatch) = @_;
  my $examples_by_pro
JSON-Schema-Generator ( A/AE/AEREAL/JSON-Schema-Generator-0.01-TRIAL.tar.gz, AEREAL, 2015; MetaCPAN )
JSON-Schema-Generator/lib/JSON/Schema/Generator/Handler/Array.pm ( view source; MetaCPAN )
package JSON::Schema::Generator::Handler::Array;

use strict;
use warnings;

sub process {
  my ($class, $array_type, $examples, $dispatch) = @_;
  return +{
    type  => $array_type->name,
    items 

Powered by Groonga
Maintained by Kenichi Ishigaki <ishigaki@cpan.org>. If you find anything, submit it on GitHub.