1

私は次のものを持っていますが、これは失敗します (0 は 3 に等しくありませんでした)。理由はわかりません。何かご意見は?

class Temp extends MyCirceExtendingClass {
  def temp(json: Json) = {
    root.otherNames.each.otherName.string.getAll(json)
  }
}

val json = Json.fromString(
  s"""
     |{
     |    id: 1,
     |    name: "Robert",
     |    isEmployee: false,
     |    otherNames: [
     |        {
     |            id: 1,
     |            otherName: "Rob"
     |        },
     |        {
     |            id: 2,
     |            otherName: "Bob"
     |        },
     |        {
     |            id: 3,
     |            otherName: "Robby"
     |        }
     |
     |    ]
     |}
     """.stripMargin)

val response = new Temp().temp(json)
response.size shouldEqual 3
4

1 に答える 1