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

K

kwatch

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: (e-mail address removed)
birth: 1980-01-01
- name: Bar
email: (e-mail address removed)
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: (e-mail address removed)
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top