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.

Exception with case classes nested within case classes #67

Description

@jxtps

For a Play framework project I'm trying to parse nested case classes like so:

case class Inner(foo: String, bar: Int)
case class Outer(hello: String, world: Inner)
val o = Outer("adam", Inner("eve", 4))
val oJson = com.codahale.jerkson.Json.generate(o)
val o2 = com.codahale.jerkson.Json.parse\[Outer\]\(oJson\)

This breaks on the last line with an exception:

Caused by: org.codehaus.jackson.map.JsonMappingException: Unable to find a case accessor for controllers.Outer
at com.codahale.jerkson.deser.CaseClassDeserializer$$anonfun$4.apply(CaseClassDeserializer.scala:39) ~[jerkson_2.9.1.jar:na]
at com.codahale.jerkson.deser.CaseClassDeserializer$$anonfun$4.apply(CaseClassDeserializer.scala:39) ~[jerkson_2.9.1.jar:na]

(at least when I run it within Play, see: https://groups.google.com/d/msg/play-framework/MKNPYOj9LBA/Ll6Fch98ZBkJ )

The issue seems to stem from: https://github.com/codahale/jerkson/blob/master/src/main/scala/com/codahale/jerkson/deser/CaseClassDeserializer.scala#L36 where it looks like it doesn't find the relevant constructor?

???

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