そのようなjsonをケースクラスに解析することはできないと思います。カスタムデシリアライザーを実行しない限り、自分で決定できます。
import org.json4s.{JValue, CustomSerializer, DefaultFormats}
import org.json4s.native.JsonMethods
import org.json4s.JsonDSL._
import org.json4s._
case class Outer(value: Inner, other: String)
case class Inner(atribute1: String, instanceId: String)
object Formats extends DefaultFormats {
val outerSerializer = new CustomSerializer[Outer](implicit format ⇒ (
{ case j: JValue ⇒ Outer(
(j \ "").extract[Inner],
(j \ "other").extract[String]
)},
{ case a: Outer ⇒
("" → Extraction.decompose(a.value)) ~
("other" → a.other)
})
)
override val customSerializers = List(outerSerializer)
}
implicit val formats = Formats
val json = """
{
"": {
"atribute1": "v1",
"instanceId": "i",
},
"other": "1"
}
"""
JsonMethods.parse(json).extract[Outer]