【问题标题】:API Platform Admin - Unable to retrieve API documentationAPI 平台管理员 - 无法检索 API 文档
【发布时间】:2019-09-17 13:36:13
【问题描述】:

我正在尝试为我的 API 创建管理面板,因此我决定生成 API Platform Admin。

我解决了 CORS 和身份验证的所有问题,但我仍然收到“无法检索 API 文档。”。开发者工具的“网络”部分没有错误。

我的 CORS 设置:

nelmio_cors:
defaults:
    origin_regex: true
    allow_origin: ['*']
    allow_methods: ['GET', 'OPTIONS', 'POST', 'PUT', 'PATCH', 'DELETE']
    allow_headers: ['Content-Type', 'Authorization', 'X-Access-Token']
    expose_headers: ['Link']
    max_age: 3600
paths:
    '^/': ~

知道如何解决这个问题吗?

no errors in developer tools

【问题讨论】:

    标签: api-platform.com


    【解决方案1】:

    如果你使用的是 Api Platform 发行版,它使用 docker-compose,所以当在“localhost”上运行时,你的浏览器(我敢打赌 Chrome)第一次阻塞了请求。

    解决方案:尝试 API 的“https”版本 (https://localhost:8443/)。

    重要提示:检查您是否可以在没有身份验证的情况下访问 API“home”(http://localhost:8080/ & https://localhost:8443/)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-03-15
      • 2019-08-01
      • 1970-01-01
      • 2022-01-23
      • 2017-11-26
      • 2011-12-01
      • 2023-03-31
      • 1970-01-01
      相关资源
      最近更新 更多