Skip to content

Conversation

rohanlopes20
Copy link

@yawkat
Copy link
Member

yawkat commented Apr 7, 2025

I'm not a fan of this change. It is a hack to work around language limitations. It makes all sorts of invalid readValue calls compile (e.g. nonsense like mapper.readValue("\"foo\"", "java.lang.String")), leading to confusing compile or runtime errors. It also breaks in more complex scenarios with generic parameters, e.g. <T> T myReadMethod(InputStream stream) { return mapper.readValue(stream); } or when deserializing parameterized types. In my opinion, this makes the API more complex and does not justify saving a few characters to specify the type.

@JooHyukKim
Copy link
Member

@yawkat has valid point. And also ObjectWriter/ObjectReader in mind, we shod be careful to not add up big complexity or API inconsistency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants