problem_helpers.go ships ProblemBadRequest/NewBadRequestProblem and ProblemNotFound/NewNotFoundProblem, but nothing for the other statuses that come up just as often in a typical API:
- 401 Unauthorized
- 403 Forbidden
- 409 Conflict
- 422 Unprocessable Entity
- 500 Internal Server Error
Without these, every call site falls back to the fully manual httpsuite.NewProblemDetails(status, type, title, detail) — which is exactly the 4-argument ceremony the NewBadRequestProblem/NewNotFoundProblem helpers exist to avoid for those two statuses.
Measured impact in one consumer (GolgiMed, ~150k LOC): 845 manual NewProblemDetails(...) calls, of which ~730 are exactly the canonical (status, "unauthorized", "Unauthorized", detail) / (status, "forbidden", "Forbidden", detail) / etc. shape that a NewUnauthorizedProblem(detail) / NewForbiddenProblem(detail) would collapse to one line.
Requested: ProblemUnauthorized/NewUnauthorizedProblem, ProblemForbidden/NewForbiddenProblem, ProblemConflict/NewConflictProblem, ProblemUnprocessable/NewUnprocessableProblem, ProblemInternal/NewInternalProblem, matching the existing ProblemBadRequest/ProblemNotFound pattern.
problem_helpers.goshipsProblemBadRequest/NewBadRequestProblemandProblemNotFound/NewNotFoundProblem, but nothing for the other statuses that come up just as often in a typical API:Without these, every call site falls back to the fully manual
httpsuite.NewProblemDetails(status, type, title, detail)— which is exactly the 4-argument ceremony theNewBadRequestProblem/NewNotFoundProblemhelpers exist to avoid for those two statuses.Measured impact in one consumer (GolgiMed, ~150k LOC): 845 manual
NewProblemDetails(...)calls, of which ~730 are exactly the canonical(status, "unauthorized", "Unauthorized", detail)/(status, "forbidden", "Forbidden", detail)/ etc. shape that aNewUnauthorizedProblem(detail)/NewForbiddenProblem(detail)would collapse to one line.Requested:
ProblemUnauthorized/NewUnauthorizedProblem,ProblemForbidden/NewForbiddenProblem,ProblemConflict/NewConflictProblem,ProblemUnprocessable/NewUnprocessableProblem,ProblemInternal/NewInternalProblem, matching the existingProblemBadRequest/ProblemNotFoundpattern.