Documented error when trying to edit default domain redirects through endpoint

This commit is contained in:
Alejandro Celaya 2021-08-03 18:33:50 +02:00
parent 7c06633a67
commit 40a7d5a112
3 changed files with 12 additions and 2 deletions

View file

@ -99,6 +99,16 @@
}
}
},
"403": {
"description": "Default domain was provided, and it cannot be edited this way.",
"content": {
"application/problem+json": {
"schema": {
"$ref": "../definitions/Error.json"
}
}
}
},
"500": {
"description": "Unexpected error.",
"content": {

View file

@ -26,7 +26,7 @@ class InvalidDomainException extends DomainException implements ProblemDetailsEx
$e->detail = $e->getMessage();
$e->title = self::TITLE;
$e->type = self::TYPE;
$e->status = StatusCodeInterface::STATUS_BAD_REQUEST;
$e->status = StatusCodeInterface::STATUS_FORBIDDEN;
return $e;
}

View file

@ -19,6 +19,6 @@ class InvalidDomainExceptionTest extends TestCase
self::assertEquals($expected, $e->getDetail());
self::assertEquals('Invalid domain', $e->getTitle());
self::assertEquals('INVALID_DOMAIN', $e->getType());
self::assertEquals(400, $e->getStatus());
self::assertEquals(403, $e->getStatus());
}
}