JSV: A Full JSON Schema Validator

899 views
Skip to first unread message

Gary Court

unread,
Jul 26, 2010, 12:15:54 AM7/26/10
to JSON Schema
I'm proud to announce that I have just released JSV: a JavaScript
implementation of a extendable, fully compliant revision 2 JSON Schema
validator!

JSV showboats the following features:

* Full implementation of the revision 2 JSON Schema specification;
will validate any JSON Schema written to this specification.
* Supports `full` and `describedby` hyper links.
* Easily extendable to include new schema attributes, value types, and
string formats.
* Validates itself, and is bootstrapped from the JSON Schema schemas.
* Includes over 170 unit tests to test all parts of the specification
& validator.
* Includes rewritten and validated schemas from the JSON Schema
specification.

JSV is currently in beta; bugs and APIs are subject to change. You can
checkout JSV from:

http://github.com/garycourt/JSV

If anyone is willing to help contribute to this project, please email
me! I'm currently lacking documentation, and some API features.

To everyone else, please enjoy this offering! Feedback is greatly
appreciated!

Thanks, and enjoy!


P.S. To the maintainer of http://json-schema.org , please take a look
at the schemas in the schemas directory of this project. They are all
written to be compliant with revision 2 of the JSON Schema
specification, and have been validated against themselves. It would be
greatly appreciated by all if you would upload these to the site,
thanks!

Monica Keller

unread,
Jul 26, 2010, 1:55:49 AM7/26/10
to JSON Schema
Wow awesome I am checking it out right now !
Thanks !

On Jul 25, 9:15 pm, Gary Court <gary.co...@gmail.com> wrote:
> I'm proud to announce that I have just released JSV: a JavaScript
> implementation of a extendable, fully compliant revision 2 JSON Schema
> validator!
>
> JSV showboats the following features:
>
> * Full implementation of the revision 2 JSON Schema specification;
> will validate any JSON Schema written to this specification.
> * Supports `full` and `describedby` hyper links.
> * Easily extendable to include new schema attributes, value types, and
> string formats.
> * Validates itself, and is bootstrapped from the JSON Schema schemas.
> * Includes over 170 unit tests to test all parts of the specification
> & validator.
> * Includes rewritten and validated schemas from the JSON Schema
> specification.
>
> JSV is currently in beta; bugs and APIs are subject to change. You can
> checkout JSV from:
>
> http://github.com/garycourt/JSV
>
> If anyone is willing to help contribute to this project, please email
> me! I'm currently lacking documentation, and some API features.
>
> To everyone else, please enjoy this offering! Feedback is greatly
> appreciated!
>
> Thanks, and enjoy!
>
> P.S. To the maintainer ofhttp://json-schema.org, please take a look

Chris Miles

unread,
Aug 16, 2010, 5:49:15 AM8/16/10
to JSON Schema
I'm having difficulty validating the card example from http://json-schema.org/card.
It seems to barf on the 'adr' $ref to address definition:

[script] path: ./card
[script] evalAndCheck: object
[script] registerSchema http://json-schema/card: Invalid
[script] 0:
[script] uri: http://json-schema/card#.properties.adr.properties.$ref
(string)
[script] schemaUri: http://json-schema.org/hyper-schema#(http%3A%2F%2Fjson-schema.org%2Fschema%23)
(string)
[script] attribute: type (string)
[script] message: Instance is not a required type (string)
[script] details: object (object)
[script] 0: object (string)

I've tried all sorts to get this type of definition working but I must
be missing something.

Can someone confirm that they have 'card' validating using JSV?

Thanks,
Chris

Gary Court

unread,
Aug 16, 2010, 11:12:10 AM8/16/10
to JSON Schema
The card schema on json-schema.org is invalid. The problem is with how
the "adr" and "geo" properties are using referencing. They should be:

"adr":{"$ref":"http://json-schema.org/address#"},
"geo":{"$ref":"http://json-schema.org/geo#"}

-Gary

On Aug 16, 3:49 am, Chris Miles <ch...@moonfruit.com> wrote:
> I'm having difficulty validating the card example fromhttp://json-schema.org/card.
> It seems to barf on the 'adr' $ref to address definition:
>
>    [script] path: ./card
>    [script] evalAndCheck: object
>    [script] registerSchemahttp://json-schema/card:Invalid
>    [script] 0:
>    [script]   uri:http://json-schema/card#.properties.adr.properties.$ref
> (string)
>    [script]   schemaUri:http://json-schema.org/hyper-schema#(http%3A%2F%2Fjson-schema.org%2Fs...)

Sky Sanders

unread,
Oct 4, 2010, 12:06:19 AM10/4/10
to JSON Schema
Gary, my primary development environment is VS which marries me to IE
for JS debugging.

It seems that JSV leverages some JS features and behavior that is not
present in IE.

The most obvious issue is the lack of Array.indexOf. I monkey patched
this and now the validation runs but finds no errors when it certainly
should.

Do you have any intentions to provide JSV in cross browser (term used
loosely) form?

b.t.w. validates just fine in FF, good work on that, but is not my
debugger.

Cheers
> > > I'm proud to announce that I have just releasedJSV: a JavaScript
Reply all
Reply to author
Forward
0 new messages