-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Annotated returns RawType in place of Generic Type in 2.7.x #1248
Comments
Agreed. PR would be welcome; either way, should be fixed for 2.7.5 |
Added overrides for |
Unfortunately this is still failing on |
@apjoseph yes, some libraries may use this method, but I don't know how widely it is used. Doesn't really help if one you are using is of course. |
One more change, should now have generic type available for |
@cowtowncoder Looks like it is still broken with 1e5d349. Below is a simple test case that demonstrates the problem. In case you are wondering why the example seems so contrived, the actual issue occurs in Rosetta - a JDBI module that uses Jackson to automatically convert JDBC ResultSets into POJOs and bind POJOS to SQL statements, which requires a special introspector and corresponding annotation for cases when the DB column is actually a stored as json in the database.
The test errors out with a nasty
in 2.7.x versions, but works fine in all earlier versions |
Ok, at this point I will need a simpler reproduction, and perhaps a fix. I unfortunately do not have time to work on this. |
This turned out to be a relatively simple fix after further investigation. |
Thanks for the fix, I'm the maintainer of Rosetta and I'll try to get it off any methods that are now deprecated before the next release |
@jhaber Great, thank you. Type resolution changes ended up much more disruptive than I hoped (although risk was there, it is a fundamental big change). Deprecated methods still exist and work in 2.8, to give bit more time, and there may not be hurry to remove them. But their behavior isn't necessarily as correct as new versions (by necessity). |
Out of curiosity, it seems like the deprecated method has signature: Since the new return type is narrower, couldn't |
@jhaber That is a possibility in theory, but the problem is that |
I see, thanks for that context |
When calling
getGenericType()
oncom.fasterxml.jackson.databind.introspect.Annotated
, 2.7.x returns the raw type instead!. I am aware that this method has been deprecated, but the current functionality results in very hard to debug issues -like aLinkedHashMap
being substituted for aList<String>
, resulting in an error when the getter is called.This method should either be removed from 2.7 -or should function correctly until it is removed. Treating the type as List is obviously not going to do anything remotely similar to what the user expects and will wreak havoc on any libraries that are maintaining backwards compatibility with older Jackson versions.
The text was updated successfully, but these errors were encountered: