Merge pull request #1617 from svetlyi/master

Exception message fix for array properties
This commit is contained in:
Guilhem Niot 2020-04-21 17:15:06 +02:00 committed by GitHub
commit 2b006dab84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,7 +32,7 @@ class ArrayPropertyDescriber implements PropertyDescriberInterface, ModelRegistr
{ {
$type = $type->getCollectionValueType(); $type = $type->getCollectionValueType();
if (null === $type) { if (null === $type) {
throw new \LogicException(sprintf('Property "%s:%s" is an array, but its items type isn\'t specified. You can specify that by using the type `string[]` for instance or `@SWG\Property(type="array", @SWG\Items(type="string"))`.', $class, $propertyName)); throw new \LogicException(sprintf('Property "%s" is an array, but its items type isn\'t specified. You can specify that by using the type `string[]` for instance or `@SWG\Property(type="array", @SWG\Items(type="string"))`.', $property->getTitle()));
} }
$property->setType('array'); $property->setType('array');