private static Object[] mungeArguments(final JsonNode node) { final Message.Builder msg = Domain.REF_RESOLVING.newMessage().setKeyword("$ref").setMessage("illegal JSON Pointer"); final Map<String, JsonNode> map = JacksonUtils.asMap(node.get("info")); for (final Map.Entry<String, JsonNode> entry : map.entrySet()) msg.addInfo(entry.getKey(), entry.getValue()); return new Object[] {node.get("input").textValue(), msg.build()}; }
@Override public void validate( final ValidationContext context, final ValidationReport report, final JsonNode instance) { final Set<String> fields = Sets.newHashSet(instance.fieldNames()); final Set<String> missing = Sets.difference(required, fields); if (missing.isEmpty()) return; final Message.Builder msg = newMsg() .addInfo("required", Ordering.natural().sortedCopy(required)) .addInfo("missing", Ordering.natural().sortedCopy(missing)) .setMessage("required property(ies) not found"); report.addMessage(msg.build()); }