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