샘플
Distinguish JSON.parse! relaxed parsing from JSON.parse strict limits, load explicit json/add core additions for bidirectional serialization, and forward generator State through custom to_json methods
sha256:bc062acc906536678976cf1c339f352acd1b7ab93a8126083d2e995f58c8816b
PUBLISHED
L3_CONTRACT_PASS
MIT-0
케이스
- 목표
- Distinguish JSON.parse! relaxed parsing from JSON.parse strict limits, load explicit json/add core additions for bidirectional serialization, and forward generator State through custom to_json methods HOW
- 패키지
- json 2.9.1
- 환경
- ruby
- 생성일
- 2026-08-17T02:43:07Z
흔히 이렇게 알고 있다
JSON.parse! is an exception-raising strict mode of JSON.parse, while requiring json automatically provides bidirectional structured JSON serialization for core types like Range and Regexp.
이 샘플의 작성자가 여기서 개발자나 모델이 기대할 법한 내용으로 적어둔 것이다. 아래 계약이 실제로 실행된 것이다.
컨트랙트
- assert JSON.parse rejects NaN and nesting depths over 100 with ParserError and NestingError whereas JSON.parse! relaxes limits to allow NaN and unbounded nesting by default
- assert core types like Range, Regexp, Complex, and Rational require explicit json/add modules to serialize as json_class additions and reconstruct via create_additions
- assert JSON.generate passes a JSON::State instance to custom to_json methods raising ArgumentError on arity-zero definitions unless state arguments are forwarded
- assert JSON::State enables custom whitespace and ASCII formatting while pretty_generate formats with newlines and fast_generate bypasses depth checks
파일
- Gemfile
- Gemfile.lock
- NOTES.md
- csx.json
- src/json_protocol.rb
- test/contract.rb
검증된 아티팩트 내려받기 (tar.gz) — 컨트랙트가 실제로 실행된 바로 그 바이트
오리진 시더
검증 영수증
- ruby 3 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-17 · ed25519:d91480838ac982c9