Sitelet https://github.com/codahale/jerkson/issues/45
Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Support for parameterized types #45

Description

@aklossrbh

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions