Expand description
RFC 9457 “Problem Details for HTTP APIs”.
ProblemDetails is the wire format for CqrsError when the
problem-json feature is enabled: responses are served as
application/problem+json with the standard members (type, title,
status, detail, instance) plus the CQRS-specific extension members
(domain, code, internalCode, details, requestId).
{
"type": "urn:cqrs-error:account:ACCOUNT_INSUFFICIENT_FUNDS",
"title": "ACCOUNT_INSUFFICIENT_FUNDS",
"status": 400,
"detail": "Cannot withdraw 500, balance is 200",
"instance": "urn:cqrs-request:req-123",
"domain": "account",
"code": "ACCOUNT_INSUFFICIENT_FUNDS",
"internalCode": 10001,
"requestId": "req-123"
}The conversion is always available, even without the feature, so an application can render problem documents on its own routes.
Structs§
- Problem
Details - An RFC 9457 problem document.
Constants§
- PROBLEM_
JSON - Media type of a problem document (RFC 9457 §3).
Functions§
- problem_
type_ base_ uri - Returns the configured base URI, if any.
- set_
problem_ type_ base_ uri - Sets the base URI used to build the
typemember of problem documents: the resulting URI is{base}/{code}(e.g.https://api.example.com/errors/ACCOUNT_INSUFFICIENT_FUNDS).