Skip to content

Commit 4e1e97b

Browse files
committed
Use Open API attributes instead of annotations within entities
1 parent 1d7572d commit 4e1e97b

File tree

4 files changed

+8
-16
lines changed

4 files changed

+8
-16
lines changed

src/Entity/ApiKey.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
use Doctrine\Common\Collections\Collection;
1919
use Doctrine\DBAL\Types\Types;
2020
use Doctrine\ORM\Mapping as ORM;
21-
use OpenApi\Annotations as OA;
21+
use OpenApi\Attributes as OA;
2222
use Ramsey\Uuid\Doctrine\UuidBinaryOrderedTimeType;
2323
use Ramsey\Uuid\UuidInterface;
2424
use Symfony\Bridge\Doctrine\Validator\Constraints as AssertCollection;
@@ -54,9 +54,6 @@ class ApiKey implements EntityInterface, UserGroupAwareInterface
5454
use Timestampable;
5555
use Uuid;
5656

57-
/**
58-
* @OA\Property(type="string", format="uuid")
59-
*/
6057
#[ORM\Id]
6158
#[ORM\Column(
6259
name: 'id',
@@ -69,6 +66,7 @@ class ApiKey implements EntityInterface, UserGroupAwareInterface
6966

7067
'LogRequest.apiKey',
7168
])]
69+
#[OA\Property(type: 'string', format: 'uuid')]
7270
private UuidInterface $id;
7371

7472
#[ORM\Column(

src/Entity/DateDimension.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
use DateTimeZone;
1616
use Doctrine\DBAL\Types\Types;
1717
use Doctrine\ORM\Mapping as ORM;
18-
use OpenApi\Annotations as OA;
18+
use OpenApi\Attributes as OA;
1919
use Ramsey\Uuid\Doctrine\UuidBinaryOrderedTimeType;
2020
use Ramsey\Uuid\UuidInterface;
2121
use Symfony\Component\Serializer\Annotation\Groups;
@@ -45,9 +45,6 @@ class DateDimension implements EntityInterface
4545
{
4646
use Uuid;
4747

48-
/**
49-
* @OA\Property(type="string", format="uuid")
50-
*/
5148
#[ORM\Id]
5249
#[ORM\Column(
5350
name: 'id',
@@ -58,6 +55,7 @@ class DateDimension implements EntityInterface
5855
'DateDimension',
5956
'DateDimension.id',
6057
])]
58+
#[OA\Property(type: 'string', format: 'uuid')]
6159
private UuidInterface $id;
6260

6361
#[ORM\Column(

src/Entity/Healthz.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use DateTimeZone;
1515
use Doctrine\DBAL\Types\Types;
1616
use Doctrine\ORM\Mapping as ORM;
17-
use OpenApi\Annotations as OA;
17+
use OpenApi\Attributes as OA;
1818
use Ramsey\Uuid\Doctrine\UuidBinaryOrderedTimeType;
1919
use Ramsey\Uuid\UuidInterface;
2020
use Symfony\Component\Serializer\Annotation\Groups;
@@ -35,9 +35,6 @@ class Healthz implements EntityInterface
3535
{
3636
use Uuid;
3737

38-
/**
39-
* @OA\Property(type="string", format="uuid")
40-
*/
4138
#[ORM\Id]
4239
#[ORM\Column(
4340
name: 'id',
@@ -48,6 +45,7 @@ class Healthz implements EntityInterface
4845
'Healthz',
4946
'Healthz.id',
5047
])]
48+
#[OA\Property(type: 'string', format: 'uuid')]
5149
private UuidInterface $id;
5250

5351
#[ORM\Column(

src/Entity/LogRequest.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use App\Entity\Traits\Uuid;
1515
use Doctrine\DBAL\Types\Types;
1616
use Doctrine\ORM\Mapping as ORM;
17-
use OpenApi\Annotations as OA;
17+
use OpenApi\Attributes as OA;
1818
use Ramsey\Uuid\Doctrine\UuidBinaryOrderedTimeType;
1919
use Ramsey\Uuid\UuidInterface;
2020
use Symfony\Component\HttpFoundation\Request;
@@ -61,9 +61,6 @@ class LogRequest implements EntityInterface
6161
use LogRequestProcessRequestTrait;
6262
use Uuid;
6363

64-
/**
65-
* @OA\Property(type="string", format="uuid")
66-
*/
6764
#[ORM\Id]
6865
#[ORM\Column(
6966
name: 'id',
@@ -77,6 +74,7 @@ class LogRequest implements EntityInterface
7774
'ApiKey.logsRequest',
7875
'User.logsRequest',
7976
])]
77+
#[OA\Property(type: 'string', format: 'uuid')]
8078
private UuidInterface $id;
8179

8280
#[ORM\Column(

0 commit comments

Comments
 (0)