Skip Menu |

This queue is for tickets about the JSON-Schema CPAN distribution.

Report information
The Basics
Id: 98643
Status: new
Priority: 0/
Queue: JSON-Schema

People
Owner: perl [...] toby.ink
Requestors: torbjorn.lindahl [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: numbe validation with scientific notation
From: torbjorn.lindahl [...] gmail.com
From: torbjorn.lindahl [...] gmail.com
Scientific notation seems to fail numbe validation, testcase: http://scsys.co.uk:8002/421538
On Fri Sep 05 09:27:33 2014, torbjorn wrote: Show quoted text
> Scientific notation seems to fail numbe validation, testcase: > http://scsys.co.uk:8002/421538
Attaching the test case on that paste, seems more permanent
Subject: foo.t
=head1 PURPOSE Various tests validating scientific numbers =cut use Test::More; use strict; use warnings; use JSON::Schema; my $schema = JSON::Schema->new({ type => 'object', properties => { mynumber => { type => 'number' } } }); my $data = { mynumber => "1e2" }; my $result = $schema->validate($data); ok $result, 'scientific notation' or map { diag "reason: $_" } $result->errors; use Scalar::Util qw/looks_like_number/; ok looks_like_number "1e2", "but it sure quacks like a duck"; done_testing;