Skip to content

Commit f42ac2f

Browse files
committed
Clean
1 parent 72f770f commit f42ac2f

File tree

3 files changed

+1
-24
lines changed

3 files changed

+1
-24
lines changed

src/main/java/com/networknt/schema/keyword/AbstractKeywordValidator.java

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,10 @@ protected boolean hasAdjacentKeywordInEvaluationPath(ExecutionContext executionC
134134
Iterator<Schema> evaluationSchemaIterator = executionContext.getEvaluationSchema().descendingIterator();
135135
boolean stop = false;
136136

137-
// ArrayDeque<Object> current = executionContext.getEvaluationSchemaPath().clone();
138-
//
139137
// Skip the first as this is the path pointing to the current keyword eg. properties eg /$ref/properties
140138
// What is needed is the evaluationPath pointing to the current evaluationSchema eg /$ref
141139
if (evaluationSchemaPathIterator.hasNext()) {
142140
evaluationSchemaPathIterator.next();
143-
// current.removeLast();
144141
}
145142

146143
while (evaluationSchemaIterator.hasNext()) {
@@ -149,24 +146,11 @@ protected boolean hasAdjacentKeywordInEvaluationPath(ExecutionContext executionC
149146
if (hasKeyword) {
150147
return true;
151148
}
152-
// for (KeywordValidator validator : schema.getValidators()) {
153-
// if (keyword.equals(validator.getKeyword())) {
154-
// return true;
155-
// }
156-
// }
157-
// String newPath = new EvaluationPath(current).toString();
158-
// String oldPath = schema.getEvaluationPath().toString();
159-
// if (!oldPath.equals(newPath)) {
160-
// System.out.println("OLD: "+oldPath);
161-
// System.out.println("NEW: "+newPath);
162-
// }
163-
164149
if (stop) {
165150
return false;
166151
}
167152
if (evaluationSchemaPathIterator.hasNext()) {
168153
Object evaluationPath = evaluationSchemaPathIterator.next();
169-
// current.removeLast();
170154
if ("properties".equals(evaluationPath) || "items".equals(evaluationPath)) {
171155
// If there is a change in instance location then after the next schema
172156
// stop

src/main/java/com/networknt/schema/keyword/RecursiveRefValidator.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,6 @@ static Schema getSchema(Schema parentSchema, ExecutionContext executionContext)
7878
@Override
7979
public void validate(ExecutionContext executionContext, JsonNode node, JsonNode rootNode, NodePath instanceLocation) {
8080
Schema refSchema = getSchemaRef(executionContext).getSchema();
81-
/*
82-
Schema check = getSchema(this.parentSchema, executionContext);
83-
if (refSchema != null && !refSchema.getSchemaLocation().equals(check.getSchemaLocation())) {
84-
System.out.println(check);
85-
System.out.println(refSchema);
86-
}
87-
*/
8881
if (refSchema == null) {
8982
Error error = error().keyword(KeywordType.RECURSIVE_REF.getValue())
9083
.messageKey("internal.unresolvedRef").message("Reference {0} cannot be resolved")

src/main/java/com/networknt/schema/utils/JsonNodeTypes.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public static boolean equalsToSchemaType(JsonNode node, JsonType schemaType, Sch
5050

5151
// Skip the type validation when the schema is an enum object schema. Since the current type
5252
// of node itself can be used for type validation.
53-
if (isEnumObjectSchema(parentSchema, executionContext) && !config.isStrict("type", Boolean.TRUE)) {
53+
if (!config.isStrict("type", Boolean.TRUE) && isEnumObjectSchema(parentSchema, executionContext)) {
5454
return true;
5555
}
5656
if (config != null && config.isTypeLoose()) {

0 commit comments

Comments
 (0)