RyanSkraba commented on code in PR #1919:
URL: https://github.com/apache/avro/pull/1919#discussion_r1000924833
##########
lang/java/avro/src/main/java/org/apache/avro/Schema.java:
##########
@@ -1619,6 +1619,16 @@ private static JsonNode validateDefault(String
fieldName, Schema schema, JsonNod
return defaultValue;
}
+ /**
+ * Checks if a JSON value matches the schema.
+ *
+ * @param jsonValue a value to check against the schema
+ * @return true if the value is valid according to this schema
+ */
+ public boolean isValidValue(JsonNode jsonValue) {
+ return isValidDefault(this, jsonValue);
+ }
Review Comment:
Is there any possible way we can rewrite this without adding or exposing the
`isValidValue(JsonNode ...)` method?
There was a reason the isValidDefault method is private: we **really** don't
want to be exposing the jackson internals in public methods and (if I remember
correctly). There was a fair amount of work deleting these methods in the
past, in order to _one day_ replace the jackson internals.
If anyone has a better memory than me, please feel to chime in!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]