fix(httputil): rename error body field platformCode → platform_code (#2)

errorBody() map key corrected from "platformCode" to "platform_code" to
match the OpenAPI spec snake_case convention. All HTTP error responses
produced by Error(w, err) now emit "platform_code" in the JSON body.
PR.md added to .gitignore.
Depends on xerrors v1.0.2 (go.mod bumped in follow-up commit after xerrors tag).

Reviewed-on: #2
Co-authored-by: Rene Nochebuena Guerrero <rene@nochebuena.dev>
Co-committed-by: Rene Nochebuena Guerrero <rene@nochebuena.dev>
This commit was merged in pull request #2.
This commit is contained in:
2026-05-21 19:34:41 -06:00
committed by NOCHEBUENADEV
parent e8adc266a6
commit b794bf668e
6 changed files with 20 additions and 6 deletions

View File

@@ -45,7 +45,7 @@ func errorBody(code, platformCode, message string, fields map[string]any) map[st
"message": message,
}
if platformCode != "" {
m["platformCode"] = platformCode
m["platform_code"] = platformCode
}
for k, v := range fields {
m[k] = v