@@ -69,7 +69,6 @@ public class Schema implements Validator {
6969
7070 private boolean validatorsLoaded = false ;
7171 private boolean recursiveAnchor = false ;
72- private TypeValidator typeValidator = null ;
7372
7473 protected final JsonNode schemaNode ;
7574 protected final Schema parentSchema ;
@@ -263,7 +262,6 @@ private Schema(SchemaContext schemaContext, SchemaLocation schemaLocation,
263262 * @param validators the validators
264263 * @param validatorsLoaded whether the validators are preloaded
265264 * @param recursiveAnchor whether this is has a recursive anchor
266- * @param typeValidator the type validator
267265 * @param id the id
268266 * @param suppressSubSchemaRetrieval to suppress sub schema retrieval
269267 * @param schemaNode the schema node
@@ -287,7 +285,6 @@ protected Schema(
287285 this .validators = validators ;
288286 this .validatorsLoaded = validatorsLoaded ;
289287 this .recursiveAnchor = recursiveAnchor ;
290- this .typeValidator = typeValidator ;
291288 this .id = id ;
292289
293290 this .schemaContext = schemaContext ;
@@ -559,10 +556,6 @@ private List<KeywordValidator> read(JsonNode schemaNode) {
559556
560557 if ("$ref" .equals (pname )) {
561558 refValidator = validator ;
562- } else if ("type" .equals (pname )) {
563- if (validator instanceof TypeValidator ) {
564- this .typeValidator = (TypeValidator ) validator ;
565- }
566559 }
567560 }
568561
@@ -594,6 +587,9 @@ private List<KeywordValidator> read(JsonNode schemaNode) {
594587 if (lhsName .equals ("discriminator" )) return -1 ;
595588 if (rhsName .equals ("discriminator" )) return 1 ;
596589
590+ if (lhsName .equals ("type" )) return -1 ;
591+ if (rhsName .equals ("type" )) return 1 ;
592+
597593 if (lhsName .equals ("properties" )) return -1 ;
598594 if (rhsName .equals ("properties" )) return 1 ;
599595 if (lhsName .equals ("patternProperties" )) return -1 ;
@@ -1566,19 +1562,6 @@ public String toString() {
15661562 return getSchemaNode ().toString ();
15671563 }
15681564
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-
15821565 public List <KeywordValidator > getValidators () {
15831566 if (this .validators == null ) {
15841567 this .validators = Collections .unmodifiableList (read (getSchemaNode ()));
0 commit comments