小编Jul*_*Smz的帖子

api platform - 无法为项目生成IRI

我从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)

我成功地在仪表板中看到了新实体(见图):

API平台Dhasboard

当我尝试获取所有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 rest symfony api-platform.com

4
推荐指数
1
解决办法
4443
查看次数

在官方 PHP docker 镜像上安装 IMAP 扩展时出错

如果您在 PHP docker 映像中安装 IMAP 扩展,则可能会出现一些错误,例如:

配置:错误:utf8_mime2text() 有新签名,但缺少 U8T_CANONICAL。这不应该发生。检查 config.log 以获取更多信息。

进而:

配置:错误:此 c 客户端库是使用 Kerberos 支持构建的。

php imap docker

3
推荐指数
1
解决办法
3951
查看次数

标签 统计

php ×2

api-platform.com ×1

docker ×1

imap ×1

rest ×1

symfony ×1