diff --git a/tests/Functional/Controller/ApiController80.php b/tests/Functional/Controller/ApiController80.php index 7b61a3ade..caab30d52 100644 --- a/tests/Functional/Controller/ApiController80.php +++ b/tests/Functional/Controller/ApiController80.php @@ -418,8 +418,6 @@ public function entityWithObjectType() /** * @Route("/entity-with-uuid", methods={"GET", "POST"}) * - * @OA\Get(operationId="entity-with-uuid") - * * @OA\Response(response=200, description="success", @OA\JsonContent( * ref=@Model(type=EntityWithUuid::class), * )) diff --git a/tests/Functional/Controller/ApiController81.php b/tests/Functional/Controller/ApiController81.php index 18d74e11b..489c92ca4 100644 --- a/tests/Functional/Controller/ApiController81.php +++ b/tests/Functional/Controller/ApiController81.php @@ -347,7 +347,6 @@ public function entityWithObjectType() } #[Route('/entity-with-uuid', methods: ['GET', 'POST'])] - #[OA\Get(operationId: 'entity-with-uuid')] #[OA\Response( response: 200, description: 'success', diff --git a/tests/Functional/Entity/EntityWithUuid.php b/tests/Functional/Entity/EntityWithUuid.php index 3b643330e..453e04331 100644 --- a/tests/Functional/Entity/EntityWithUuid.php +++ b/tests/Functional/Entity/EntityWithUuid.php @@ -6,8 +6,8 @@ class EntityWithUuid { - public ?Uuid $id; - private string $name; + public Uuid $id; + public string $name; public function __construct(string $name) { diff --git a/tests/Functional/FunctionalTest.php b/tests/Functional/FunctionalTest.php index 3d5b1ccfc..7b7d987cc 100644 --- a/tests/Functional/FunctionalTest.php +++ b/tests/Functional/FunctionalTest.php @@ -900,11 +900,28 @@ public function testEntityWithUuid() { $model = $this->getModel('EntityWithUuid'); + $json = json_decode($model->toJson(), true); + $this->assertSame('object', $model->type); $this->assertSame('id', $model->properties[0]->property); $this->assertSame('string', $model->properties[0]->type); $this->assertSame('uuid', $model->properties[0]->format); + + $this->assertEquals([ + 'schema' => 'EntityWithUuid', + 'type' => 'object', + 'required' => ['id', 'name'], + 'properties' => [ + 'id' => [ + 'type' => 'string', + 'format' => 'uuid', + ], + 'name' => [ + 'type' => 'string', + ] + ], + ], json_decode($model->toJson(), true)); } public function testEntitiesWithRefInSchemaDoNoReadOtherProperties(): void