refactor(api): standardise unauthorised wording
Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
parent
eceda4e5c1
commit
f2f262a4c2
5 changed files with 6 additions and 6 deletions
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ class ApiKeyAuthExtension implements Extension
|
|||
'properties' => [
|
||||
'message' => [
|
||||
'type' => 'string',
|
||||
'example' => 'This action is unauthorized.',
|
||||
'example' => 'This action is unauthorised.',
|
||||
],
|
||||
],
|
||||
];
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ class AuthenticateApiKey
|
|||
}
|
||||
|
||||
/**
|
||||
* Return 401 Unauthorized response.
|
||||
* Return 401 Unauthorised response.
|
||||
*/
|
||||
protected function unauthorized(string $message): Response
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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' => [],
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue