GetProblemTypeURL reads from a package-level defaultProblemConfig (built once via NewProblemConfig()), but there's no exported way to replace it — only DefaultProblemConfig() (read-only copy) and the per-call ParseOptions.Problems override on ParseRequest.
Consumers that want a custom BaseURL (to emit real RFC 9457 type URIs instead of bare words like "unauthorized") or additional ErrorTypePaths globally have no way to configure this once at startup — they'd have to pass ParseOptions.Problems on every single ParseRequest call, and there's no equivalent hook at all for the direct helpers (NewProblemDetails, ProblemBadRequest, etc.), which always resolve via the package-level default.
Found while auditing usage across a ~150k LOC service (GolgiMed): 60+ call sites construct ProblemDetails with a bare-word type ("unauthorized", "forbidden", ...) instead of a proper URI, because there's no way to register a base URL once and have every helper pick it up.
Requested: SetProblemConfig(cfg ProblemConfig) (mirroring SetValidator/ClearValidator's pattern) so an app can configure BaseURL + ErrorTypePaths once at composition root.
GetProblemTypeURLreads from a package-leveldefaultProblemConfig(built once viaNewProblemConfig()), but there's no exported way to replace it — onlyDefaultProblemConfig()(read-only copy) and the per-callParseOptions.Problemsoverride onParseRequest.Consumers that want a custom
BaseURL(to emit real RFC 9457typeURIs instead of bare words like"unauthorized") or additionalErrorTypePathsglobally have no way to configure this once at startup — they'd have to passParseOptions.Problemson every singleParseRequestcall, and there's no equivalent hook at all for the direct helpers (NewProblemDetails,ProblemBadRequest, etc.), which always resolve via the package-level default.Found while auditing usage across a ~150k LOC service (GolgiMed): 60+ call sites construct
ProblemDetailswith a bare-wordtype("unauthorized","forbidden", ...) instead of a proper URI, because there's no way to register a base URL once and have every helper pick it up.Requested:
SetProblemConfig(cfg ProblemConfig)(mirroringSetValidator/ClearValidator's pattern) so an app can configureBaseURL+ErrorTypePathsonce at composition root.