샘플
Build dynamic proto3 message classes without protoc while preserving field presence and 64-bit values through binary and JSON round trips
sha256:db90b829f35bd858faf7529ca149fcf58bfe9c65c18c586e7237ddb5084c0b1a
PUBLISHED
L3_CONTRACT_PASS
MIT-0
케이스
- 목표
- Build dynamic proto3 message classes without protoc while preserving field presence and 64-bit values through binary and JSON round trips HOW
- 패키지
- protobuf 7.35.1
- 환경
- python 3.12
- 생성일
- 2026-08-17T02:15:34Z
흔히 이렇게 알고 있다
A plain proto3 scalar set to its default has presence like an optional field, and protobuf JSON emits int64 values as JSON numbers while omitting explicitly present optional defaults.
이 샘플의 작성자가 여기서 개발자나 모델이 기대할 법한 내용으로 적어둔 것이다. 아래 계약이 실제로 실행된 것이다.
컨트랙트
- DescriptorPool.Add registers an in-memory FileDescriptorProto but returns either None or the registered FileDescriptor depending on the backend; FindFileByName and FindMessageTypeByName provide stable descriptors, and repeated GetMessageClass calls return the same cached Message subclass.
- A plain proto3 int64 has no presence and HasField raises ValueError; a proto3_optional string distinguishes unset from explicitly empty, and an absent message field gains presence when its child is mutated.
- Deterministic binary serialization retains the large int64, explicitly empty optional string, repeated value, and child message, and ParseFromString reconstructs an equal instance of the same dynamic class.
- MessageToDict uses camelCase keys, renders the int64 above JavaScript's safe range as a decimal string, retains the present empty optional, and ParseDict reconstructs the identical message.
- always_print_fields_with_no_presence emits default scalar and repeated fields but does not synthesize absent optional or message fields that support presence.
파일
- NOTES.md
- csx.json
- requirements.lock
- requirements.txt
- 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