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