Skip to content

Commit

Permalink
+1 for readability
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert-van-Engelen committed Oct 8, 2016
1 parent ef7ec85 commit cdc0520
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,16 @@ Example usage:
try {
SJOT.validate(obj, "#Data", schema);
} catch (e) {
window.alert(e); // validation failed
window.alert(e); // FAIL: validation failed
}

// check if schema is compliant and correct, if not throws an exception with diagnostics:
SJOT.check(schema);

// SJOT.check(schema) checks if schema is compliant and correct, if not throws an exception with diagnostics:
try {
SJOT.check(schema);
} catch (e) {
window.alert(e); // FAIL: schema is not compliant or correct
}

sjot.js is fully functional to validate JSON data, but the current version has
some limitations:
Expand Down

0 comments on commit cdc0520

Please sign in to comment.