JsonSchemaAnnotatorChecker (@NotNull Project project, @NotNull JsonValueAdapter elementToCheck, final @NotNull MatchResult result, @NotNull JsonComplianceCheckerOptions options) { final List<JsonSchemaAnnotatorChecker> checkers = new ArrayList<>(); if (result.myExcludingSchemas.isEmpty() && result.mySchemas.size() == 1) { final JsonSchemaAnnotatorChecker checker = new JsonSchemaAnnotatorChecker(project, options); checker.checkByScheme(elementToCheck, result.mySchemas.iterator().next()); checkers.add(checker); } else { if (!result.mySchemas.isEmpty()) { checkers.add(processSchemasVariants(project, result.mySchemas, elementToCheck, false, options).getSecond()); } if (!result.myExcludingSchemas.isEmpty()) { // we can have several oneOf groups, each about, for instance, a part of properties // - then we should allow properties from neighbour schemas (even if additionalProperties=false) final List<JsonSchemaAnnotatorChecker> list = ContainerUtil.map(result.myExcludingSchemas, group -> processSchemasVariants(project, group, elementToCheck, true, options).getSecond()); checkers.add(mergeErrors(project, list, options, result.myExcludingSchemas)); } } if (checkers.isEmpty()) return null; if (checkers.size() == 1) return checkers.get(0); return checkers.stream() .filter(checker -> !checker.isHadTypeError()) .findFirst() .orElse(checkers.get(0)); }