-
-
Notifications
You must be signed in to change notification settings - Fork 142
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
add Scala3 equivalent of ScalaObjectMapper #503
Comments
I didn't look closely to the code yet but what do you use from If you need to access type parameters of a generic type, this is exactly the use case I'm currently dealing with in a library (Cucumber Scala) and after looking at izumi I built a minimal library to cover the need: https://github.com/gaeljw/typetrees. Maybe you can grab some ideas there 🤷 (Not saying you should use my library, I wouldn't be confident using it in such a big project as Jackson for now 😅 ) |
@gaeljw the manifests are basically used here - https://github.com/FasterXML/jackson-module-scala/blob/2.12/src/main/scala/com/fasterxml/jackson/module/scala/ScalaObjectMapper.scala#L67 I see this as a convenience because in most cases, it's possible to use the Jackson ObjectMapper java methods directly and pass the type reference explicitly. |
I've open a draft proposal without using macros at #518 but I may be missing some stuff that make this proposal inadequate. |
This code is merged but causes build problems with Scala 2.13 - see #522 |
That's weird. I'll give it a look event though I'm not sure I have useful knowledge to understand such behaviour. |
jackson-module-scala 2.13.0-rc1 is released |
|
@tnielens try doing a PR of your own - ScalaObjectMapper has never compiled under Scala 3 for me - we have ClassTagExtensions as a like for like replacement for ScalaObjectMapper and that works with Scala 3 (see the jackson-scala-module 2.13.0-rc2 release) |
My bad, |
@tnielens the trait still exists but at compile time no value for the implicits instances will be provided by the compiler (or is it at runtime that there's an error? I don't remember exactly). But pretty sure that it doesn't work anymore and even if it works it's been deprecated since Scala 2.11, thus we should not rely on it. |
ScalaObjectMapper is a mixin for Jackson ObjectMapper that provides some helper functions that use Scala Manifests to implicitly access type information.
Scala Manifests are not supported for Scala3.
The options would appear to be.
The text was updated successfully, but these errors were encountered: