【问题标题】:Unexpected token in Nelmio api doc bundleNelmio api 文档包中的意外标记
【发布时间】:2023-02-05 18:58:01
【问题描述】:

我刚刚创建了一个新的 Symfony 5 项目,然后按照中所述安装Nelmio API doc https://symfony.com/bundles/NelmioApiDocBundle/current/index.html

如上所述,我也有以下补充。

配置/路由/nelmio_api_doc.yaml

app.swagger_ui:
    path: /api/doc
    methods: GET
    defaults: { _controller: nelmio_api_doc.controller.swagger_ui }

配置/包/nelmio_api_doc.yaml

nelmio_api_doc:
    documentation:
        info:
            title: MyApp
            version: 1.0.0
    areas: # to filter documented areas
        path_patterns:
            - ^/api(?!(/_.*)|(/doc))# Accepts routes under /api except /api/doc
        host_patterns:
            - ^api\.

但是当我打开 localhost:8000/api/doc 时,我在控制台中看到错误后的空白页面。

有人可以帮我解决这个问题吗?

【问题讨论】:

    标签: symfony5 nelmioapidocbundle


    【解决方案1】:

    有人找到解决方案我有同样的问题

    【讨论】:

      猜你喜欢
      • 2016-03-27
      • 2020-05-05
      • 2017-12-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-01-27
      • 1970-01-01
      相关资源
      最近更新 更多