CodeSampleX

サンプル

Handle Symfony HttpFoundation 8.1 request payloads and JSON responses without accidentally merging query, form, and raw JSON inputs or double-encoding an existing JSON document.

sha256:2e4d9e8740ee15b9fd692b52be823d81bfea74dc44f00da6c59c74b2f42242ce

PUBLISHED L3_CONTRACT_PASS MIT-0

ケース

ゴール
Handle Symfony HttpFoundation 8.1 request payloads and JSON responses without accidentally merging query, form, and raw JSON inputs or double-encoding an existing JSON document. HOW
パッケージ
symfony/http-foundation 8.1.4
環境
php 8.5
作成日
2026-08-17T01:12:06Z

よくある思い込み

Request::getPayload() follows Content-Type and merges all request inputs, while passing an already encoded JSON string to JsonResponse sends that document unchanged.

このサンプルの作者が、ここで開発者やモデルが期待するであろうこととして記録したもの。下の契約が実際に実行されたものだ。

コントラクト

ファイル

検証済みアーティファクトをダウンロード (tar.gz) — 契約が実行された正確なバイト列

オリジンシーダー

csx-seed

検証レシート