2013-02-28 2 views
1

문제는 :JSON 중첩 너무 깊은

JSON::NestingError: nesting of 101 is too deep

나는 아무 소용와 :max_nesting => 120JSON.parse 줄을 추가 시도했습니다.

그런 다음 OJ로 전환하면 변경 될지 확인합니다.

아이디어가 있으십니까?

+0

실제로 101 단계 중첩이 있습니까? 너 정말 필요해? –

+0

나는 외부 API를 대규모로 호출하고 있습니다. 나는 주변에 방법이 보이지 않는다 ... – abhir

답변

1

max_nesting 옵션이있는 Calll JSON.parse. 그것은 나를 위해 작동합니다.

> o = JSON.parse(File.read(Rails.root.join("deep.json"))) 
JSON::NestingError: nesting of 101 is too deep 
> o = JSON.parse(File.read(Rails.root.join("deep.json")),max_nesting: 150) 
# { Big ol' deeply nested hash } 
관련 문제