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

Discussion in 'Ruby' started by kwatch, May 30, 2006.

  1. kwatch

    kwatch Guest

    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
    kwatch, May 30, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. makoto kuwata
    Replies:
    0
    Views:
    139
    makoto kuwata
    Jan 27, 2008
  2. Florian Frank
    Replies:
    0
    Views:
    240
    Florian Frank
    Jun 30, 2009
  3. makoto kuwata
    Replies:
    0
    Views:
    147
    makoto kuwata
    Jul 18, 2010
  4. Jean-Christophe Le Lann

    require 'kwalify' fails

    Jean-Christophe Le Lann, Feb 4, 2011, in forum: Ruby
    Replies:
    1
    Views:
    84
    Jörg W Mittag
    Feb 5, 2011
  5. Acácio Centeno
    Replies:
    1
    Views:
    254
    dieter
    Feb 15, 2013
Loading...

Share This Page