1
다음과 같은 오류가 있습니다 (0은 3이 아님). 이유를 모르겠습니다. 이견있는 사람?JSON의 Circe 추출 목록
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