Skip to content
Gnof edited this page Apr 13, 2015 · 2 revisions

Here are some examples of how to use the JsonValidator library:

import com.gnof.core.JsonValidator;

// JSON Validation Object
String basicValidationJson = "{attribute: foo}";
// Target JSON to Validate
String targetJson = "{foo:bar, foo:bat}"

// Instantiate JsonValidation Object
JsonValidator validator = new JsonValidator();
// validate returns a boolean of whether the validation passed
boolean result = validator.validate(basicValidationJson, targetJson);

System.out.println(result)
>> true

Clone this wiki locally