[ANN] Kwalify 0.7.2 - parser, schema validator, and data binding forYAML and JSON

M

makoto kuwata

Hi,

I released Kwalify 0.7.2. This is a bug fix release.
http://www.kuwata-lab.com/kwalify/


Overview
--------

Kwalify is an integrated tool for YAML and JSON.
Kwalify contains parser, schema validator, and data binding tool.

See User's Guide for details.
http://www.kuwata-lab.com/kwalify/ruby/users-guide.html


Example
-------

Schema example (schema.yaml):

type: seq
sequence:
- type: map
class: Member
mapping:
"name": { type: str, required: true }
"gender": { type: str, required: true, enum: [M, F] }
"role": { type: str, required: false }


YAML data example (data.yaml):

- name: Haruhi Suzumiya
gender: F
role: Leader of SOS Brigade
- name: Mikuru Asahina
gender: W
role: Time Traveler
- namae: Yuki Nagato
gender: F
role: Humanoid Interface


Schema validation example:

$ kwalify -lf sos.schema sos.data
sos.data#0: INVALID
- (line 5) [/1/gender] 'W': invalid gender value.
- (line 7) [/2] key 'name:' is required.
- (line 7) [/2/namae] key 'namae:' is undefined.


Class generation example:

$ kwalify -a genclass-java -f schema.yaml
generating ./Member.java...done.
$ cat ./Member.java
// generated by kwalify from schema.yaml

import java.util.*;

/**
*
*/
public class Member {

private String _name;
private String _gender;
private String _role;

public Member() {}

public Member(Map map) {
_name = (String)map.get("name");
_gender = (String)map.get("gender");
_role = (String)map.get("role");
}

public String getName() { return _name; }
public void setName(String name_) { _name = name_; }
public String getGender() { return _gender; }
public void setGender(String gender_) { _gender = gender_; }
public String getRole() { return _role; }
public void setRole(String role_) { _role = role_; }
}


Changes from 0.7.1
------------------

* [bugfix] fix kwalify command not to raise error when YAML document
is empty (thanks to Nuttall).
* [bugfix] fix Kwalify::Util.untabify() not to remove tailing empty
strings.
 

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

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top