refactor(http): decode request payload without reshaping it - #141
refactor(http): decode request payload without reshaping it#141ArnabChatterjee20k wants to merge 1 commit into
Conversation
decodePayload previously walked the decoded body to turn objects into
associative arrays while keeping empty objects as stdClass, so the
request layer both decoded and reshaped the payload. Decode to the
natural PHP shape instead — objects stay stdClass, lists stay arrays —
which keeps {} distinct from [] without the reshape. Consumers that
want an associative shape now transform explicitly at their own layer.
Greptile SummaryThe PR stops recursively reshaping decoded JSON objects into associative arrays while retaining the top-level parameter map expected by the request API.
Confidence Score: 5/5The PR appears safe to merge, with the intentional payload-shape change consistently implemented and covered across the affected request paths. The shared decoder preserves the required top-level parameter array, leaves nested JSON values in their natural PHP representations, and remains compatible with the repository’s route binding and round-trip behavior. Important Files Changed
Reviews (1): Last reviewed commit: "refactor(http): decode request payload w..." | Re-trigger Greptile |
Benchmark resultshttp — Swoole modes (4 cores, 200 VUs, 20s/run)
a = HYPERLOOP_A (process), b = HYPERLOOP_B (coroutine) Shared CI runners — treat absolute numbers as rough, compare modes within a run. Commit c241903. |
decodePayload previously walked the decoded body to turn objects into associative arrays while keeping empty objects as stdClass, so the request layer both decoded and reshaped the payload. Decode to the natural PHP shape instead — objects stay stdClass, lists stay arrays — which keeps {} distinct from [] without the reshape. Consumers that want an associative shape now transform explicitly at their own layer.