Skip to content

Commit

Permalink
update readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
sijoonlee committed Aug 28, 2020
1 parent a2bdb4f commit 2e2e2ba
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,3 +229,19 @@
```
4. Run editor to manipulate schema first and pass the edited schema to Validator
```
// load schema file to Editor
SchemaEditor editor = new SchemaEditor("example/example6/usingEditor_schema.json");
// edit
editor.setFieldRequired("simple.test6", "field1");
editor.setFieldRuleEqualTo("simple.test6", "field1", "abc");
// pass the edited schema to Validator
ArrayList<SchemaRecord> schemas = editor.getSchemas();
SchemaValidator validator = new SchemaValidator(schemas);
// Run validator
boolean isValid = validator.run("example/example6/usingEditor.json", "simple.test6");
```

0 comments on commit 2e2e2ba

Please sign in to comment.