Fix User Warning: Multiple definitions for @OA\\Property()->title (#1630)

* Fix User Warning: Multiple definitions for @OA\\Property()->title

* Add test

* Pass CI..
This commit is contained in:
Mantis Development 2020-05-31 09:30:13 +01:00 committed by GitHub
parent 4027fe8b6c
commit 5e6b894bdc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 32 additions and 1 deletions

View File

@ -50,8 +50,8 @@ class AnnotationsReader
public function updateProperty(\ReflectionProperty $reflectionProperty, OA\Property $property, array $serializationGroups = null): void
{
$this->phpDocReader->updateProperty($reflectionProperty, $property);
$this->openApiAnnotationsReader->updateProperty($reflectionProperty, $property, $serializationGroups);
$this->phpDocReader->updateProperty($reflectionProperty, $property);
$this->symfonyConstraintAnnotationReader->updateProperty($reflectionProperty, $property);
}
}

View File

@ -48,6 +48,8 @@ class JMSUser
private $email;
/**
* User Roles Comment.
*
* @Serializer\Type("array<string>")
* @Serializer\Accessor(getter="getRoles", setter="setRoles")
* @Serializer\Expose
@ -56,6 +58,14 @@ class JMSUser
*/
private $roles;
/**
* User Location.
*
* @Serializer\Type("string")
* @Serializer\Expose
*/
private $location;
/**
* @Serializer\Type("string")
*/

View File

@ -31,6 +31,8 @@ class User
private $email;
/**
* User Roles Comment.
*
* @var string[]
*
* @OA\Property(
@ -42,6 +44,13 @@ class User
*/
private $roles;
/**
* User Location.
*
* @OA\Property(type = "string")
*/
private $location;
/**
* @var int
*
@ -112,6 +121,10 @@ class User
$this->roles = $roles;
}
public function setLocation(string $location)
{
}
/**
* @param int $friendsNumber
*/

View File

@ -172,6 +172,10 @@ class FunctionalTest extends WebTestCase
'items' => ['type' => 'string'],
'default' => ['user'],
],
'location' => [
'title' => 'User Location.',
'type' => 'string',
],
'friendsNumber' => [
'type' => 'string',
],

View File

@ -103,6 +103,10 @@ class JMSFunctionalTest extends WebTestCase
'default' => ['user'],
'description' => 'Roles list',
],
'location' => [
'type' => 'string',
'title' => 'User Location.',
],
'friendsNumber' => [
'type' => 'string',
'maxLength' => 100,