Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > [ANN] Kwalify 0.6.0 - a schema validator for YAML and JSON

Reply
Thread Tools

[ANN] Kwalify 0.6.0 - a schema validator for YAML and JSON

 
 
kwatch
Guest
Posts: n/a
 
      05-30-2006
I have released Kwalify 0.6.0.
http://www.kuwata-lab.com/kwalify

Kwalify is a schema validator for YAML and JSON.

Example:

schema.yaml : example of schema file
--------------------
type: seq
sequence:
- type: map
mapping:
"name": { type: str, required: yes }
"email": { type: str, pattern: /@/ }
"birth": { type: date }
"blood": { type: str, enum: [A, B, O, AB] }
--------------------

data1.yaml: example of valid YAML file
--------------------
- name: Foo
email:
birth: 1980-01-01
- name: Bar
email:
blood: A
--------------------

valdation:
====================
$ kwalify -lf schema.yaml data1.yaml
data1.yaml#0: valid.
====================

data2.yaml: example of invalid YAML file
--------------------
- name: Foo
email: foo.mail.com
birth: 1980/01/01
- naem: Bar
email:
blood: a
--------------------

validation:
====================
$ kwalify -lf schema.yaml data2.yaml
- (line 2) [/0/email] 'foo.mail.com': not matched to pattern /@/.
- (line 3) [/0/birth] '1980/01/01': not a date.
- (line 4) [/1/naem] key 'naem:' is undefined.
- (line 4) [/1] key 'name:' is required.
- (line 6) [/1/blood] 'a': invalid blood value.
====================


Changes from 0.5.1:

[enhances]
* Class definition generation support.
New command-line option '-a genclass-ruby' or '-a genclass-java'
generates class definitions in Ruby or Java from schema file.
See users' guide for details.


--
regards,
kwatch

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Lib to generate XML/JSON[P] output from a DTD/XSD/JSON Schema/etc Acácio Centeno Python 1 02-15-2013 07:34 AM
require 'kwalify' fails Jean-Christophe Le Lann Ruby 1 02-05-2011 02:16 AM
[ANN] Kwalify 0.7.2 - parser, schema validator, and data binding forYAML and JSON makoto kuwata Ruby 0 07-18-2010 12:50 AM
[ANN] Kwalify 0.7.0 - parser, schema validator, and data binding forYAML and JSON makoto kuwata Ruby 0 01-27-2008 03:41 PM
Validation with XSD using XML::LibXML::Schema, and XML::Validator::Schema huntingseasonson@gmail.com Perl Misc 5 11-29-2006 12:37 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57