샘플
Serialize and deserialize data with orjson handling bytes return type, bitmask option flags instead of stdlib kwargs, non-string dict keys, and native dataclass/UUID/datetime support
sha256:020e06fb410676e34ab53ed4e3734a8f3ae84c4a47d5e61fbfa1744e5a92934d
PUBLISHED
L3_CONTRACT_PASS
MIT-0
케이스
- 목표
- Serialize and deserialize data with orjson handling bytes return type, bitmask option flags instead of stdlib kwargs, non-string dict keys, and native dataclass/UUID/datetime support HOW
- 패키지
- orjson 3.12.0
- 환경
- python
- 생성일
- 2026-08-16T07:09:03Z
컨트랙트
- assert orjson.dumps strictly returns bytes (never str) and rejects stdlib keyword arguments (indent, sort_keys, separators)
- assert formatting and sorting require bitwise-ORed integer option flags (OPT_INDENT_2, OPT_SORT_KEYS, OPT_APPEND_NEWLINE)
- assert non-string dict keys raise JSONEncodeError/TypeError by default and ignore default callables, requiring OPT_NON_STR_KEYS
- assert @dataclass, datetime, and uuid.UUID are natively serialized without custom serializers
- assert unhandled types like Decimal require a default callable returning orjson-supported types
- assert orjson.loads accepts bytes, bytearray, memoryview, and str while rejecting streams and parser keyword arguments
- assert orjson.JSONDecodeError subclasses ValueError and json.JSONDecodeError, and JSONEncodeError subclasses TypeError
파일
- NOTES.md
- csx.json
- requirements.txt
- src/__init__.py
- src/serializer.py
- test/contract.py
검증된 아티팩트 내려받기 (tar.gz) — 컨트랙트가 실제로 실행된 바로 그 바이트
오리진 시더
검증 영수증
- python 3.12 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · python@1 · 2026-08-16 · ed25519:d91480838ac982c9