CodeSampleX

サンプル

orjson 3.12.0: Configure orjson option bitmasks to intercept subclasses, dataclasses, naive timestamps, and JS-safe integers that default serialization silently bypasses or corrupts

検証済みサンプル — pypi orjson 3.12.0: Configure orjson option bitmasks to intercept subclasses, dataclasses, naive timestamps, and JS-safe integers that default…

sha256:05f2672095e6b40251604acdb3f1cf2defa139aa701bc9f92f5d48baa62b229e

このネットワークが提供するのは一つだけです。ビルドされるサンプル。サンドボックスで実行し、署名済みの受領証を保管します。等級はつけず、何も保証しません — 同じコードがあなたの環境でビルドされるかは測定していません。 合格した契約受領証を提出した異なる署名鍵の数です。1 なら作者だけ、2 以上なら他の誰かもビルドしています。鍵は自己生成で背後に登録された身元がないため、数えているのは人ではなく鍵です。 MIT-0

実行証拠

宣言された環境と署名済みの実行を分けてあります。このサンプルが何をどこで実行したかをそのまま確認できます。

証拠の基準
署名済みコントラクト合格
検証レシート
2
ビルドした署名鍵
2
宣言された環境 python linux x64 python python pip

検証実行環境

環境 コントラクト ステージ 実行日
python 3.12 · linux alpine/x64 · docker ed25519:d91480838ac982c9 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · python@1
2026-08-16
python 3.12 · linux alpine/x64 · docker ed25519:2175b912ea1c23b1 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · python@1
2026-08-18

ケース

HOW
ゴール
Configure orjson option bitmasks to intercept subclasses, dataclasses, naive timestamps, and JS-safe integers that default serialization silently bypasses or corrupts
パッケージ
シンボル
  • orjson.dumps
  • orjson.loads
  • orjson.Fragment
  • orjson.OPT_PASSTHROUGH_SUBCLASS
  • orjson.OPT_PASSTHROUGH_DATACLASS
  • orjson.OPT_PASSTHROUGH_DATETIME
  • orjson.OPT_STRICT_INTEGER
  • orjson.OPT_NAIVE_UTC
  • orjson.OPT_UTC_Z
  • orjson.OPT_APPEND_NEWLINE
環境
python
作成日
2026-08-16T07:09:11Z

コントラクト

  1. assert primitive subclasses bypass the default hook and serialize raw unless OPT_PASSTHROUGH_SUBCLASS is set
  2. assert dataclasses bypass the default hook and serialize all fields natively unless OPT_PASSTHROUGH_DATACLASS is set
  3. assert datetime objects bypass the default hook unless OPT_PASSTHROUGH_DATETIME is set
  4. assert OPT_UTC_Z alone has no effect on naive datetimes, requiring OPT_NAIVE_UTC composed via bitwise OR to emit Zulu format
  5. assert integers within 53-bit range serialize under OPT_STRICT_INTEGER while integers exceeding 2**53-1 raise TypeError
  6. assert orjson.Fragment splices raw buffers zero-copy and raises TypeError during dumps if the content is not bytes or str
  7. assert dumps parameter is singular 'option' raising TypeError on 'options', and invalid bitmasks raise TypeError
  8. assert OPT_APPEND_NEWLINE writes a trailing newline and composed options execute simultaneously in a single dumps pass

ファイル

  • NOTES.md
  • csx.json
  • requirements.txt
  • src/__init__.py
  • src/config.py
  • test/contract.py

ソースアーティファクトをダウンロード (tar.gz)

オリジンシーダー

csx-seed