我从API平台开始,我正在使用示例实体"Foo":
namespace AppBundle\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
use Doctrine\ORM\Mapping as ORM;
/**
* Foo
*
* @ORM\Table(name="foo")
* @ApiResource
* @ORM\Entity
*/
class Foo
{
/**
* @var string
*
* @ORM\Column(name="bar", type="string", length=255, nullable=false)
*/
private $bar;
/**
* @var integer
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
}
Run Code Online (Sandbox Code Playgroud)
我成功地在仪表板中看到了新实体(见图):
当我尝试获取所有Foo集合时出现以下错误:
curl -X GET "http://127.0.0.1:8000/foos" -H "accept: application/json"
{
"type": "https://tools.ietf.org/html/rfc2616#section-10",
"title": "An error occurred",
"detail": "Unable to generate an IRI for the item of type …Run Code Online (Sandbox Code Playgroud) 如果您在 PHP docker 映像中安装 IMAP 扩展,则可能会出现一些错误,例如:
配置:错误:utf8_mime2text() 有新签名,但缺少 U8T_CANONICAL。这不应该发生。检查 config.log 以获取更多信息。
进而:
配置:错误:此 c 客户端库是使用 Kerberos 支持构建的。