Centralized prefix for problem detail types

This commit is contained in:
Alejandro Celaya
2022-08-14 13:12:10 +02:00
parent 2650cb89b5
commit a41835573b
16 changed files with 77 additions and 51 deletions

View File

@@ -6,12 +6,14 @@ use Laminas\Stratigility\Middleware\ErrorHandler;
use Mezzio\ProblemDetails\ProblemDetailsMiddleware;
use Shlinkio\Shlink\Common\Logger;
use function Shlinkio\Shlink\Core\toProblemDetailsType;
return [
'problem-details' => [
'default_types_map' => [
404 => 'NOT_FOUND', // TODO Define new values, with backwards compatibility if possible
500 => 'INTERNAL_SERVER_ERROR', // TODO Define new values, with backwards compatibility if possible
404 => toProblemDetailsType('not-found'),
500 => toProblemDetailsType('internal-server-error'),
],
],