refactor(api): standardise unauthorised wording

Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
Virgil 2026-04-01 20:59:55 +00:00
parent eceda4e5c1
commit f2f262a4c2
5 changed files with 6 additions and 6 deletions

View file

@ -64,7 +64,7 @@ readonly class ApiResponse
302 => 'Found (redirect)',
304 => 'Not modified',
400 => 'Bad request',
401 => 'Unauthorized',
401 => 'Unauthorised',
403 => 'Forbidden',
404 => 'Not found',
405 => 'Method not allowed',

View file

@ -53,7 +53,7 @@ class ApiKeyAuthExtension implements Extension
'properties' => [
'message' => [
'type' => 'string',
'example' => 'This action is unauthorized.',
'example' => 'This action is unauthorised.',
],
],
];

View file

@ -116,7 +116,7 @@ class AuthenticateApiKey
}
/**
* Return 401 Unauthorized response.
* Return 401 Unauthorised response.
*/
protected function unauthorized(string $message): Response
{

View file

@ -40,7 +40,7 @@ class ErrorResource extends JsonResource
/**
* Common error factory methods.
*/
public static function unauthorized(string $message = 'Unauthorized'): static
public static function unauthorized(string $message = 'Unauthorised'): static
{
return new static('unauthorized', $message);
}

View file

@ -398,7 +398,7 @@ describe('ApiResponse Attribute Rendering', function () {
201 => 'Resource created',
204 => 'No content',
400 => 'Bad request',
401 => 'Unauthorized',
401 => 'Unauthorised',
403 => 'Forbidden',
404 => 'Not found',
422 => 'Validation error',
@ -724,7 +724,7 @@ describe('Extension System', function () {
// ─────────────────────────────────────────────────────────────────────────────
describe('Error Response Documentation', function () {
it('documents 401 Unauthorized response', function () {
it('documents 401 Unauthorised response', function () {
$extension = new ApiKeyAuthExtension;
$spec = [
'info' => [],