Skip to content

Commit e1ce67d

Browse files
committed
fixes #273 make the getInstance() deprecated
1 parent 6f4a06e commit e1ce67d

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/main/java/com/networknt/schema/JsonSchemaFactory.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,14 @@ static Builder builder() {
188188
return new Builder();
189189
}
190190

191+
/**
192+
* @deprecated
193+
* This is a method that is kept to ensure backward compatible. You shouldn't use it anymore.
194+
* Please specify the draft version when get an instance.
195+
*
196+
* @return JsonSchemaFactory
197+
*/
198+
@Deprecated
191199
public static JsonSchemaFactory getInstance() {
192200
return getInstance(SpecVersion.VersionFlag.V4);
193201
}

src/test/java/com/networknt/schema/V4JsonSchemaTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040
public class V4JsonSchemaTest {
4141
protected ObjectMapper mapper = new ObjectMapper();
42-
protected JsonSchemaFactory validatorFactory = JsonSchemaFactory.builder(JsonSchemaFactory.getInstance()).objectMapper(mapper).build();
42+
protected JsonSchemaFactory validatorFactory = JsonSchemaFactory.builder(JsonSchemaFactory.getInstance(SpecVersion.VersionFlag.V4)).objectMapper(mapper).build();
4343
protected static Undertow server = null;
4444

4545
public V4JsonSchemaTest() {

0 commit comments

Comments
 (0)