i'm trying to validate Json Objects. I use https://code.google.com/p/rest-assured/wiki/Downloads?tm=2,
import static com.jayway.restassured.module.jsv.JsonSchemaValidator.matchesJsonSchemaInClasspath;
import static org.hamcrest.MatcherAssert.assertThat;
import org.junit.Test;
public class testClass {
@Test public void
validates_schema_in_classpath() {
// Given
String JsonString = "{\"isSuccess\":false}";// Greeting response
// Then
assertThat(JsonString, matchesJsonSchemaInClasspath("greeter-schema.json"));
}
}
greeter-schema.json:http://cs606926.vk.me/v606926718/15603/0Kauo1bTDi8.jpg
I have OK result everytime even if JsonString is not equal this "{\"isSuccess\":false}".
For example I get OK result when JsonString="{\"isSuccess\":false},{\"isFalse\":true}", or "{\"isSuccess\":false},testetstets"