Christian Schiffler 8da1ac0296 Pass real property to swagger annotation reader
The type invariation (changing from the real property to the sub items
definition) causes the swagger annotations to end up on the created
`Items` entry.
This changes the behaviour to update the real property entry with the
swagger annotation.

Additionally this ensures that "description", "title" and "example" are
only updated on `Schema` instances.
2017-12-15 17:39:18 +01:00

123 lines
2.0 KiB
PHP

<?php
/*
* This file is part of the NelmioApiDocBundle package.
*
* (c) Nelmio
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Nelmio\ApiDocBundle\Tests\Functional\Entity;
use Swagger\Annotations as SWG;
/**
* @author Guilhem N. <egetick@gmail.com>
*/
class User
{
/**
* @var integer
*
* @SWG\Property(description = "User id", required = true, readOnly = true, title = "userid", example=1)
*/
private $id;
/**
* @var string
*
* @SWG\Property(readOnly = false)
*/
private $email;
/**
* @var string[]
*
* @SWG\Property(
* description = "User roles",
* type = "array",
* items=@SWG\Items(type="string"),
* required = true,
* title = "roles",
* example="[""ADMIN"",""SUPERUSER""]")
* )
*/
private $roles;
/**
* @var int
*
* @SWG\Property(type = "string")
*/
private $friendsNumber;
/**
* @var float
*/
private $money;
/**
* @var \DateTime
*/
private $createdAt;
/**
* @var User[]
*/
private $users;
/**
* @param float $money
*/
public function setMoney(float $money)
{
$this->money = $money;
}
/**
* @param int $id
*/
public function setId(int $id)
{
$this->id = $id;
}
/**
* @param string $email
*/
public function setEmail(string $email)
{
$this->email = $email;
}
/**
* @param string[] $roles
*/
public function setRoles(array $roles)
{
$this->roles = $roles;
}
/**
* @param int $friendsNumber
*/
public function setFriendsNumber(int $friendsNumber)
{
$this->friendsNumber = $friendsNumber;
}
public function setCreatedAt(\DateTime $createAt)
{
}
public function setUsers(array $users)
{
}
public function setDummy(Dummy $dummy)
{
}
}