Skip to content

Commit dcb51d2

Browse files
committed
fixes #71 Github Quickstart section out-of-date
1 parent bb4ebe9 commit dcb51d2

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

README.md

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33

44
# json-schema-validator
55

6-
A Java json schema validator that support json schema draft v4. It is a key component in our
7-
[light-java](https://github.com/networknt/light-java) microservices framework to validate request
8-
against OpenAPI specification at runtime.
6+
A Java json schema validator that supports json schema draft v4. It is a key component in our
7+
[light-4j](https://github.com/networknt/light-4j) microservices framework to validate request
8+
against OpenAPI specification for [light-rest-4j](http://www.networknt.com/style/light-rest-4j/)
9+
and RPC schema for [light-hybrid-4j](http://www.networknt.com/style/light-hybrid-4j/) at runtime.
910

1011

1112
* [Why to use this library?](#why-to-use-this-library)
@@ -30,7 +31,7 @@ specification. It uses the [Jackson](https://github.com/FasterXML/jackson) for j
3031

3132
You can run the performance tests for three libraries from [https://github.com/networknt/json-schema-validator-perftest](https://github.com/networknt/json-schema-validator-perftest)
3233

33-
* It uses jackson which is the most popular JSON parser in Java.
34+
* It uses Jackson which is the most popular JSON parser in Java.
3435

3536

3637

@@ -42,7 +43,7 @@ Add the following to your `pom.xml`:
4243
<dependency>
4344
<groupId>com.networknt</groupId>
4445
<artifactId>json-schema-validator</artifactId>
45-
<version>0.1.7</version>
46+
<version>0.1.16</version>
4647
</dependency>
4748
```
4849

@@ -104,35 +105,36 @@ public class BaseJsonSchemaValidatorTest {
104105
}
105106

106107
protected JsonSchema getJsonSchemaFromClasspath(String name) throws Exception {
107-
JsonSchemaFactory factory = new JsonSchemaFactory();
108+
JsonSchemaFactory factory = JsonSchemaFactory.getInstance();
108109
InputStream is = Thread.currentThread().getContextClassLoader()
109110
.getResourceAsStream(name);
110111
JsonSchema schema = factory.getSchema(is);
111112
return schema;
112113
}
113114

115+
114116
protected JsonSchema getJsonSchemaFromStringContent(String schemaContent) throws Exception {
115-
JsonSchemaFactory factory = new JsonSchemaFactory();
117+
JsonSchemaFactory factory = JsonSchemaFactory.getInstance();
116118
JsonSchema schema = factory.getSchema(schemaContent);
117119
return schema;
118120
}
119121

120122
protected JsonSchema getJsonSchemaFromUrl(String url) throws Exception {
121-
JsonSchemaFactory factory = new JsonSchemaFactory();
123+
JsonSchemaFactory factory = JsonSchemaFactory.getInstance();
122124
JsonSchema schema = factory.getSchema(new URL(url));
123125
return schema;
124126
}
125127

126128
protected JsonSchema getJsonSchemaFromJsonNode(JsonNode jsonNode) throws Exception {
127-
JsonSchemaFactory factory = new JsonSchemaFactory();
129+
JsonSchemaFactory factory = JsonSchemaFactory.getInstance();
128130
JsonSchema schema = factory.getSchema(jsonNode);
129131
return schema;
130132
}
131133
}
132134

133135
```
134-
And the following is one of the test case in one of the test class extends from above base class. As you can see, it constructs JsonSchema
135-
and JsonNode from String.
136+
And the following is one of the test cases in one of the test classes extends from above base class. As you can see, it constructs
137+
JsonSchema and JsonNode from String.
136138

137139
```java
138140
JsonSchema schema = getJsonSchemaFromStringContent("{\"enum\":[1, 2, 3, 4],\"enumErrorCode\":\"Not in the list\"}");
@@ -144,15 +146,12 @@ and JsonNode from String.
144146

145147
## Known issues
146148

147-
I have just updated the test suites from the [official website](https://github.com/json-schema-org/JSON-Schema-Test-Suite) as the old ones were copied from another
148-
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. As my old test suites
149-
were inherited from another Java JSON Schema Validator, I guess other Java Validator would have the same issues as these issues are in the Java Language itself.
149+
I have just updated the test suites from the [official website](https://github.com/json-schema-org/JSON-Schema-Test-Suite) 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
150+
but need to be investigated. As my old test suites were inherited from another Java JSON Schema Validator, I guess other Java Validator would have the same issues as these issues are in the Java Language itself.
150151

151152
[#7](https://github.com/networknt/json-schema-validator/issues/7)
152153

153154
[#6](https://github.com/networknt/json-schema-validator/issues/6)
154155

155156
[#5](https://github.com/networknt/json-schema-validator/issues/5)
156157

157-
158-

0 commit comments

Comments
 (0)