【发布时间】:2019-02-07 15:11:10
【问题描述】:
我正在使用 symfony 4 的 api 平台。尝试使用 DTO 输出类并遵循文档 (https://api-platform.com/docs/core/dto/)。
我的班级看起来像这样:
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use ApiPlatform\Core\Annotation\ApiResource;
use App\DTO\ElementDTO;
/**
* Elements
* @ORM\Table(name="elements")
* @ORM\Entity
* @ApiResource(
* inputClass=false,
* outputClass=ElementDTO::class
* )
*/
class Elements
{
}
但是,我收到如下所示的错误:
Unknown property "inputClass" on annotation "ApiPlatform\Core\Annotation\ApiResource".
我搜索了api平台的源代码,没有找到对inputClass或outputClass的引用。文档中的方法是否已弃用或尚未实现?
【问题讨论】:
标签: symfony annotations api-platform.com