mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-03-12 10:36:09 +03:00
Fix the JMSModelDescriber
This commit is contained in:
parent
429d809f41
commit
c1903db109
@ -93,14 +93,17 @@ class JMSModelDescriber implements ModelDescriberInterface, ModelRegistryAwareIn
|
|||||||
$reflections[] = new \ReflectionProperty($item->class, $item->name);
|
$reflections[] = new \ReflectionProperty($item->class, $item->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
if (null !== $item->getter) {
|
||||||
if (null !== $item->getter) {
|
try {
|
||||||
$reflections[] = new \ReflectionMethod($item->class, $item->getter);
|
$reflections[] = new \ReflectionMethod($item->class, $item->getter);
|
||||||
|
} catch (\ReflectionException $ignored) {
|
||||||
}
|
}
|
||||||
if (null !== $item->setter) {
|
}
|
||||||
|
if (null !== $item->setter) {
|
||||||
|
try {
|
||||||
$reflections[] = new \ReflectionMethod($item->class, $item->setter);
|
$reflections[] = new \ReflectionMethod($item->class, $item->setter);
|
||||||
|
} catch (\ReflectionException $ignored) {
|
||||||
}
|
}
|
||||||
} catch (\ReflectionExceptions $ignored) {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$groups = $this->computeGroups($context, $item->type);
|
$groups = $this->computeGroups($context, $item->type);
|
||||||
|
@ -40,6 +40,7 @@ class VirtualProperty
|
|||||||
/**
|
/**
|
||||||
* @Serializer\Accessor(getter="getFoo", setter="setFoo")
|
* @Serializer\Accessor(getter="getFoo", setter="setFoo")
|
||||||
* @Serializer\Type("string")
|
* @Serializer\Type("string")
|
||||||
|
* @Serializer\Expose
|
||||||
*
|
*
|
||||||
* Ensures https://github.com/nelmio/NelmioApiDocBundle/issues/1708 is fixed.
|
* Ensures https://github.com/nelmio/NelmioApiDocBundle/issues/1708 is fixed.
|
||||||
*/
|
*/
|
||||||
|
@ -280,6 +280,9 @@ class JMSFunctionalTest extends WebTestCase
|
|||||||
'email' => [
|
'email' => [
|
||||||
'type' => 'string',
|
'type' => 'string',
|
||||||
],
|
],
|
||||||
|
'virtualprop' => [
|
||||||
|
'type' => 'string',
|
||||||
|
],
|
||||||
],
|
],
|
||||||
], $this->getModel('VirtualProperty')->toArray());
|
], $this->getModel('VirtualProperty')->toArray());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user