Skip to content

Commit 1d07c1e

Browse files
committed
Disable 404 status on version endpoint; Add new description to version endpoint
1 parent 38d73da commit 1d07c1e

File tree

4 files changed

+19
-8
lines changed

4 files changed

+19
-8
lines changed

docker-compose.override.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@
5454
#
5555
# ===========================================
5656

57-
version: "3.8"
58-
5957
# Configures the services
6058
services:
6159

docker-compose.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@
5454
#
5555
# ===========================================
5656

57-
version: "3.8"
58-
5957
# Configures the services
6058
services:
6159

src/ApiPlatform/Resource/Version.php

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<?php
22

3-
declare(strict_types=1);
4-
53
/*
64
* This file is part of the ixnode/php-api-version-bundle project.
75
*
@@ -11,6 +9,8 @@
119
* file that was distributed with this source code.
1210
*/
1311

12+
declare(strict_types=1);
13+
1414
namespace Ixnode\PhpApiVersionBundle\ApiPlatform\Resource;
1515

1616
use ApiPlatform\Metadata\Get;
@@ -27,7 +27,20 @@
2727
*/
2828
#[Get(
2929
openapiContext: [
30-
'description' => VersionRoute::DESCRIPTION
30+
'summary' => VersionRoute::SUMMARY_GET,
31+
'description' => VersionRoute::DESCRIPTION_GET,
32+
'responses' => [
33+
'200' => [
34+
'description' => 'Version resource',
35+
'content' => [
36+
'application/json' => [
37+
'schema' => [
38+
'$ref' => "#/components/schemas/Version"
39+
]
40+
]
41+
]
42+
]
43+
]
3144
],
3245
provider: VersionProvider::class
3346
)]

src/ApiPlatform/Route/VersionRoute.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,7 @@ final class VersionRoute extends BaseRoute
2626
{
2727
final public const PROPERTIES = [];
2828

29-
public const DESCRIPTION = "# Version resource\nRetrieves a Version resource.";
29+
public const SUMMARY_GET = 'Retrieves a Version resource';
30+
31+
public const DESCRIPTION_GET = 'This endpoint is used to obtain the versions of this application.';
3032
}

0 commit comments

Comments
 (0)