Skip to content

[BUG] POST /v1/participants returns unclear error for malformed JSON #1545

Open @Parikalp-Bhardwaj opened 2026-08-04 19:19 UTC 1 comment Updated 2026-09-28 19:18 UTC
bug

Description

POST /v1/participants returns a nested parser error when the request body contains malformed JSON.

Current behavior

{"error":{"message":"unexpected EOF"}}

Expected behavior

{"error":"Invalid request body"}

💬 Comments (1)

@redstartechno commented 2026-09-28 19:18 UTC

There are now three open PRs for this issue, all changing the same line in decentralized-api/internal/server/public/post_participant_handler.go. Listing them side by side so one can be picked and the others closed:

PR Opened Handler change Test
#1546 2026-08-04 "Invalid request body" + .SetInternal(err) (keeps the original error for logs) Adds a malformed-JSON test, but it asserts only the status code and logs the body
#1678 2026-08-30 "Invalid request body" None
#1865 2026-09-27 "Invalid request body" Asserts the JSON body for malformed JSON and for missing fields

1546 does not reference this issue in its description, which is probably why the later two were opened.

This is a comparison of the diffs only; I did not run the tests of #1865 or #1678.


🔄 Auto-synced from Issue #1545 every hour.