Skip to content

Commit e69887c

Browse files
committed
use map
1 parent a47333a commit e69887c

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,15 @@ protected boolean hasAdjacentKeywordInEvaluationPath(ExecutionContext executionC
159159

160160
while (evaluationSchemaIterator.hasNext()) {
161161
Schema schema = evaluationSchemaIterator.next();
162-
for (KeywordValidator validator : schema.getValidators()) {
163-
if (keyword.equals(validator.getKeyword())) {
164-
return true;
165-
}
162+
boolean hasKeyword = schema.getSchemaNode().has(keyword);
163+
if (hasKeyword) {
164+
return true;
166165
}
166+
// for (KeywordValidator validator : schema.getValidators()) {
167+
// if (keyword.equals(validator.getKeyword())) {
168+
// return true;
169+
// }
170+
// }
167171
// String newPath = new EvaluationPath(current).toString();
168172
// String oldPath = schema.getEvaluationPath().toString();
169173
// if (!oldPath.equals(newPath)) {

0 commit comments

Comments
 (0)