| commit | 461f4e038381d93be2e5eed12aa9c45af7efd469 | [log] [tgz] |
|---|---|---|
| author | Steve Hu <stevehu@gmail.com> | Fri Oct 21 07:18:44 2016 -0400 |
| committer | Steve Hu <stevehu@gmail.com> | Fri Oct 21 07:18:44 2016 -0400 |
| tree | 6b973e34c7c3b5e597c0fd5564c51868885e8fa4 | |
| parent | bbfe46f83bdab6809566fd9ce5f0bc53ddceb92b [diff] |
add travis ci
A Java json schema validator that support json schema draft v4. It is a key component in our light-java microservices framework to validate request against OpenAPI specification at runtime.
This project is an implementation of the JSON Schema Core Draft v4 specification. It uses the Jackson for json parsing.
fge: 7130ms
everit-org: 1168ms
networknt: 223ms
You can run the performance tests for three libraries from https://github.com/networknt/json-schema-validator-perftest
Add the following to your pom.xml:
<dependency> <groupId>com.networknt</groupId> <artifactId>json-schema-validator</artifactId> <version>0.1.2</version> </dependency>
JsonSchema schema = getJsonSchemaFromStringContent("{\"enum\":[1, 2, 3, 4],\"enumErrorCode\":\"Not in the list\"}");
JsonNode node = getJsonNodeFromStringContent("7");
Set<ValidationMessage> errors = schema.validate(node);
assertThat(errors.size(), is(1));
I have just updated the test suites from the official website as the old ones were copied from another Java validator. Now there are several issues that need to be addressed. All of them are edge cases in my opinion but need to be investigated.