【发布时间】: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