od },
#pod };
#pod
#pod my $schema = $rx->make_schema($success);
#pod
#pod my $reply = $json->decode( $agent->get($http_request) );
#pod
#pod die "invalid reply" unless $schema->check($rep
ents => '//str',
},
},
};
my $schema = $rx->make_schema($success);
my $reply = $json->decode( $agent->get($http_request) );
die "invalid reply" unless $schema->check($reply);
=he
fined($value)
and ref($value)
and (
eval { $value->isa('JSON::XS::Boolean') }
or
eval { $value->isa('JSON::PP::Boolean') }
or
eval { $value->isa('boolean') }
h $value;
# XXX: This is insufficiently precise. It's here to keep us from believing
# that JSON::XS::Boolean objects, which end up looking like 0 or 1, are
# integers. -- rjbs, 2008-07-24
$
});
}
return 1 unless ref $value and ! (
eval { $value->isa('JSON::XS::Boolean') }
or
eval { $value->isa('JSON::PP::Boolean') }
or
eval { $value->isa('boolean') }
);
$s
});
}
# XXX: This is insufficiently precise. It's here to keep us from believing
# that JSON::XS::Boolean objects, which end up looking like 0 or 1, are
# integers. -- rjbs, 2008-07-24
i
",
value => $value,
});
}
# XXX: Really, we need a way to know whether (say) the JSON was one of the
# following: { "foo": 1 } or { "foo": "1" }
# Only one of those is providing
#pod if you prefer!)
#pod
#pod =item *
#pod
#pod Rx's type C<//bool> is deliberately targeted at JSON like boolean objects, so
#pod we'll also accept undef and 1 as "truthy" values.
#pod
#pod =back
#
definition of a schema,
if you prefer!)
=item *
Rx's type C<//bool> is deliberately targeted at JSON like boolean objects, so
we'll also accept undef and 1 as "truthy" values.
=back
As we are expe