mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 07:41:43 +03:00
Merge pull request #2045 from manowark/fix-error-in-symfony-constraint-annotation-reader
Fix type error in SymfonyConstraintAnnotationReader
This commit is contained in:
commit
f331441521
@ -225,7 +225,7 @@ class SymfonyConstraintAnnotationReader
|
|||||||
{
|
{
|
||||||
return count(array_intersect(
|
return count(array_intersect(
|
||||||
$validationGroups ?: [Constraint::DEFAULT_GROUP],
|
$validationGroups ?: [Constraint::DEFAULT_GROUP],
|
||||||
$annotation->groups
|
(array) $annotation->groups
|
||||||
)) > 0;
|
)) > 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
namespace Nelmio\ApiDocBundle\Tests\Functional\Entity;
|
namespace Nelmio\ApiDocBundle\Tests\Functional\Entity;
|
||||||
|
|
||||||
|
use OpenApi\Annotations as OA;
|
||||||
use Symfony\Component\Serializer\Annotation\Groups;
|
use Symfony\Component\Serializer\Annotation\Groups;
|
||||||
use Symfony\Component\Validator\Constraints as Assert;
|
use Symfony\Component\Validator\Constraints as Assert;
|
||||||
|
|
||||||
@ -31,4 +32,12 @@ class SymfonyConstraintsWithValidationGroups
|
|||||||
* @Assert\Range(min=1, max=100)
|
* @Assert\Range(min=1, max=100)
|
||||||
*/
|
*/
|
||||||
public $propertyInDefaultGroup;
|
public $propertyInDefaultGroup;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var array
|
||||||
|
*
|
||||||
|
* @OA\Property(type="array", @OA\Items(type="string"))
|
||||||
|
* @Assert\Valid
|
||||||
|
*/
|
||||||
|
public $propertyArray;
|
||||||
}
|
}
|
||||||
|
@ -66,6 +66,12 @@ class ValidationGroupsFunctionalTest extends WebTestCase
|
|||||||
'maximum' => 100,
|
'maximum' => 100,
|
||||||
'minimum' => 1,
|
'minimum' => 1,
|
||||||
],
|
],
|
||||||
|
'propertyArray' => [
|
||||||
|
'type' => 'array',
|
||||||
|
'items' => [
|
||||||
|
'type' => 'string',
|
||||||
|
],
|
||||||
|
],
|
||||||
],
|
],
|
||||||
'type' => 'object',
|
'type' => 'object',
|
||||||
'schema' => 'SymfonyConstraintsDefaultGroup',
|
'schema' => 'SymfonyConstraintsDefaultGroup',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user