mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-09 02:59:27 +03:00
Ignore Type::$nullable (#1391)
This commit is contained in:
parent
0e72b64e3c
commit
99833189fd
@ -110,6 +110,8 @@ class ObjectModelDescriber implements ModelDescriberInterface, ModelRegistryAwar
|
||||
$property->setType('string');
|
||||
$property->setFormat('date-time');
|
||||
} else {
|
||||
$type = new Type($type->getBuiltinType(), false, $type->getClassName(), $type->isCollection(), $type->getCollectionKeyType(), $type->getCollectionValueType()); // ignore nullable field
|
||||
|
||||
$property->setRef(
|
||||
$this->modelRegistry->register(new Model($type, $model->getGroups()))
|
||||
);
|
||||
|
@ -66,6 +66,11 @@ class User
|
||||
*/
|
||||
private $users;
|
||||
|
||||
/**
|
||||
* @var User|null
|
||||
*/
|
||||
private $friend;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
@ -118,6 +123,10 @@ class User
|
||||
{
|
||||
}
|
||||
|
||||
public function setFriend(self $friend = null)
|
||||
{
|
||||
}
|
||||
|
||||
public function setDummy(Dummy $dummy)
|
||||
{
|
||||
}
|
||||
|
@ -41,6 +41,8 @@ class FunctionalTest extends WebTestCase
|
||||
$modelProperties = $this->getModel('Article')->getProperties();
|
||||
$this->assertCount(1, $modelProperties);
|
||||
$this->assertTrue($modelProperties->has('author'));
|
||||
$this->assertSame('#/definitions/User2', $modelProperties->get('author')->getRef());
|
||||
|
||||
$this->assertFalse($modelProperties->has('content'));
|
||||
}
|
||||
|
||||
@ -209,6 +211,9 @@ class FunctionalTest extends WebTestCase
|
||||
],
|
||||
'type' => 'array',
|
||||
],
|
||||
'friend' => [
|
||||
'$ref' => '#/definitions/User',
|
||||
],
|
||||
'dummy' => [
|
||||
'$ref' => '#/definitions/Dummy2',
|
||||
],
|
||||
|
Loading…
x
Reference in New Issue
Block a user