ProblemDetails() renders errors attached via Context.Error as an RFC 9457
problem details JSON response when the handler chain finishes without
writing a response. The response status code is kept when it is an error
status, otherwise it defaults to 500 Internal Server Error.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Add first-class support for RFC 9457 "Problem Details for HTTP APIs"
error responses in JSON format:
- gin.Problem type with the standard members (type, title, status,
detail, instance) and extension members serialized at the top level
- render.ProblemJSON renderer setting Content-Type to
"application/problem+json; charset=utf-8"
- Context.ProblemJSON and Context.AbortWithProblemJSON helpers; when
given a gin.Problem, a zero Status defaults to the response code and
an empty Title defaults to http.StatusText
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>