gortiz commented on code in PR #8736:
URL: https://github.com/apache/pinot/pull/8736#discussion_r879073754
##########
pinot-spi/src/main/java/org/apache/pinot/spi/utils/JsonUtils.java:
##########
@@ -81,7 +81,7 @@ private JsonUtils() {
public static final ObjectReader DEFAULT_READER = DEFAULT_MAPPER.reader();
public static final ObjectWriter DEFAULT_WRITER = DEFAULT_MAPPER.writer();
public static final ObjectWriter DEFAULT_PRETTY_WRITER =
DEFAULT_MAPPER.writerWithDefaultPrettyPrinter();
- private static final TypeReference<HashMap<String, Object>>
GENERIC_JSON_TYPE =
+ public static final TypeReference<HashMap<String, Object>> GENERIC_JSON_TYPE
=
Review Comment:
Why not? I understand we should not expose the ObjectMapper because it may
be mutated, but object is immutable and may be useful to have a single instance
if someone has to do some advance usage of Jackson.
I mean, I would think that JsonUtils is used to avoid repetition and useless
object creation, not to prevent devs to know about Jackson. The same we expose
DEFAULT_WRITER, DEFAULT_PRETTY_WRITER and DEFAULT_READER, we can (and I would
say should) expose GENERIC_JSON_TYPE
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]