You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.
Jerkson can't deserialize into parameterized types. For example (based on ExampleCaseClasses.scala):
case class CaseClassWithList[T](id: Long, list: List[T])
parse[CaseClassWithList[CaseClass]]("""{"id":1,"list":[{"id":1,"name":"Coda"}]}""")
will throw a java.lang.ClassNotFoundException: T. Unlike issue #9, I'd like to be able to hint in the scala code (not in the JSON) that the parameterized type should be a CaseClass. I think something like parse[CaseClassWithList[CaseClass]](arg, List[Class]) where the list of classes would specify the parameterized types that ClassFileParser can't determine from the bytecode.
Thoughts? Is there a better way to do this? I made a commit in my fork of jerkson which has the full (failing) test case if that helps.
The text was updated successfully, but these errors were encountered:
I've recently encountered this limitation myself. What workaround have you found? I am pretty close to resorting to parsing into an Array[Any], re-generating the JSON string for each entry, then deserializing those strings. This doubles my parsing work, but will work around the problem.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Jerkson can't deserialize into parameterized types. For example (based on ExampleCaseClasses.scala):
will throw a
java.lang.ClassNotFoundException: T
. Unlike issue #9, I'd like to be able to hint in the scala code (not in the JSON) that the parameterized type should be aCaseClass
. I think something likeparse[CaseClassWithList[CaseClass]](arg, List[Class])
where the list of classes would specify the parameterized types that ClassFileParser can't determine from the bytecode.Thoughts? Is there a better way to do this? I made a commit in my fork of jerkson which has the full (failing) test case if that helps.
The text was updated successfully, but these errors were encountered: