샘플
Configure Ruby JSON parsing and generation options across max_nesting, freeze, create_additions, and script_safe without falling into JSON.load keyword-proc collision or unescaped script tags
sha256:872c9e461ccac83e7b19625704d8e2280fefb4903330c45f8b5925114ada2453
PUBLISHED
L3_CONTRACT_PASS
MIT-0
케이스
- 목표
- Configure Ruby JSON parsing and generation options across max_nesting, freeze, create_additions, and script_safe without falling into JSON.load keyword-proc collision or unescaped script tags HOW
- 패키지
- json 2.9.1
- 환경
- ruby
- 생성일
- 2026-08-17T02:43:04Z
컨트랙트
- assert JSON.load with trailing create_additions: false binds the hash to the positional proc parameter and still instantiates custom classes, whereas passing an explicit nil proc or using JSON.parse safely returns a Hash
- assert JSON.parse rejects nesting depth exceeding 100 with JSON::NestingError, but max_nesting: 0, false, and nil all disable depth enforcement completely rather than forbidding nesting
- assert JSON.parse with freeze: true deeply freezes all containers, nested arrays, strings, and symbolized keys, raising FrozenError on in-place mutation at any depth
- assert JSON.generate leaves </script> unescaped by default, while script_safe: true escapes </ to <\/ without altering round-trip parsed data and ascii_only: true encodes non-ASCII into unicode escapes
- assert custom container classes passed via object_class receive Symbol keys directly when symbolize_names: true is enabled
파일
- Gemfile
- Gemfile.lock
- NOTES.md
- csx.json
- src/json_config.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