|
This post originated from an RSS feed registered with Ruby Buzz
by Red Handed.
|
Original Post: Kwalify is YAML Schemas
Feed Title: RedHanded
Feed URL: http://redhanded.hobix.com/index.xml
Feed Description: sneaking Ruby through the system
|
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Red Handed
Latest Posts From RedHanded
|
|
Wow, look what showed up today. Kwalify.
If you have a YAML document that looks like this:
name: foo
email: foo@mail.com
age: 20
birth: 1985-01-01
Add a Kwalify schema file:
type: map
mapping:
name: {type: string, required: yes}
email: {type: string, pattern: /@/}
age: {type: integer}
birth: {type: date}
To validate:
kwalify -f schema.yaml example.yaml
KWOOL!! In hasty eagerness, I whipped up a schema for an example feed. Well done, Makoto Kuwata! To boot, the validator is perfectly scriptable. (Seen on del.icio.us/tag/yaml.)
Read: Kwalify is YAML Schemas