jackson-module-kotlin icon indicating copy to clipboard operation
jackson-module-kotlin copied to clipboard

Custom methods cannot be used for map types and generics

Open ming0804 opened this issue 4 years ago • 9 comments

Describe the bug Custom methods cannot be used for map types and generics To Reproduce Test case or steps to reproduce the behavior or. image image image image

long to string , So is generics image

Expected behavior {"aa":"324"}

Versions Kotlin: 1.4.20 Jackson-module-kotlin: 2.11.3 Jackson-databind: 2.11.3

ming0804 avatar Mar 29 '21 02:03 ming0804

Would you make a reproduction repository? Also, might give 2.12 a try.

dinomite avatar Mar 29 '21 20:03 dinomite

image image image

Only valid for data class Neither generic nor map tests work

ming0804 avatar Mar 30 '21 07:03 ming0804

image

ming0804 avatar Mar 30 '21 07:03 ming0804

@dinomite

ming0804 avatar Mar 31 '21 00:03 ming0804

@ming0804 Did you create a reproduction test case as requested? Copying from a set of screenshots is unnecessary work and a self-contained unit test would be much preferred. You may also want to verify whether issue occurs with 2.12.2 as 2.11.3 is not the latest version available (there is also 2.11.4 patch after it).

cowtowncoder avatar Mar 31 '21 03:03 cowtowncoder

https://github.com/ming0804/jackson431test I wonder if this case is feasible ,Maybe I didn’t use jackson correctly @cowtowncoder

ming0804 avatar Mar 31 '21 06:03 ming0804

Thanks for the repo, I'll try to look at it this week.

dinomite avatar Mar 31 '21 10:03 dinomite

Definitely broken and definitely still broken in 2.12 😔

@ming0804 What name should I use for crediting you reporting this issue?

dinomite avatar Apr 03 '21 14:04 dinomite

@ming0804 Would you fill it out and email a scan/photo of the result to info at fasterxml dot com? That will allow me to credit you for the test case contribution.

https://github.com/FasterXML/jackson/blob/master/contributor-agreement.pdf

dinomite avatar Apr 03 '21 15:04 dinomite