@@ -69,7 +69,6 @@ public class Schema implements Validator {
69
69
70
70
private boolean validatorsLoaded = false ;
71
71
private boolean recursiveAnchor = false ;
72
- private TypeValidator typeValidator = null ;
73
72
74
73
protected final JsonNode schemaNode ;
75
74
protected final Schema parentSchema ;
@@ -263,7 +262,6 @@ private Schema(SchemaContext schemaContext, SchemaLocation schemaLocation,
263
262
* @param validators the validators
264
263
* @param validatorsLoaded whether the validators are preloaded
265
264
* @param recursiveAnchor whether this is has a recursive anchor
266
- * @param typeValidator the type validator
267
265
* @param id the id
268
266
* @param suppressSubSchemaRetrieval to suppress sub schema retrieval
269
267
* @param schemaNode the schema node
@@ -287,7 +285,6 @@ protected Schema(
287
285
this .validators = validators ;
288
286
this .validatorsLoaded = validatorsLoaded ;
289
287
this .recursiveAnchor = recursiveAnchor ;
290
- this .typeValidator = typeValidator ;
291
288
this .id = id ;
292
289
293
290
this .schemaContext = schemaContext ;
@@ -559,10 +556,6 @@ private List<KeywordValidator> read(JsonNode schemaNode) {
559
556
560
557
if ("$ref" .equals (pname )) {
561
558
refValidator = validator ;
562
- } else if ("type" .equals (pname )) {
563
- if (validator instanceof TypeValidator ) {
564
- this .typeValidator = (TypeValidator ) validator ;
565
- }
566
559
}
567
560
}
568
561
@@ -594,6 +587,9 @@ private List<KeywordValidator> read(JsonNode schemaNode) {
594
587
if (lhsName .equals ("discriminator" )) return -1 ;
595
588
if (rhsName .equals ("discriminator" )) return 1 ;
596
589
590
+ if (lhsName .equals ("type" )) return -1 ;
591
+ if (rhsName .equals ("type" )) return 1 ;
592
+
597
593
if (lhsName .equals ("properties" )) return -1 ;
598
594
if (rhsName .equals ("properties" )) return 1 ;
599
595
if (lhsName .equals ("patternProperties" )) return -1 ;
@@ -1566,19 +1562,6 @@ public String toString() {
1566
1562
return getSchemaNode ().toString ();
1567
1563
}
1568
1564
1569
- public boolean hasTypeValidator () {
1570
- return getTypeValidator () != null ;
1571
- }
1572
-
1573
- public TypeValidator getTypeValidator () {
1574
- // As the validators are lazy loaded the typeValidator is only known if the
1575
- // validators are not null
1576
- if (this .validators == null ) {
1577
- getValidators ();
1578
- }
1579
- return this .typeValidator ;
1580
- }
1581
-
1582
1565
public List <KeywordValidator > getValidators () {
1583
1566
if (this .validators == null ) {
1584
1567
this .validators = Collections .unmodifiableList (read (getSchemaNode ()));
0 commit comments