问题描述
我开始是这样安装的:
https://symfony.com/doc/4.x/bundles/NelmioApiDocBundle/index.html
第 1 步。
`composer require nelmio/api-doc-bundle` - Thats OK
第 2 步。
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = [
new Nelmio\ApiDocBundle\NelmioApiDocBundle(),];
}
}
但是我没有 AppKernel 扩展内核。我**只有内核**和
`$contents = require $this->getProjectDir().'/config/bundles.PHP';`
所以我添加到 **/config/bundles.PHP**
Nelmio\ApiDocBundle\NelmioApiDocBundle::class => ['all' => true],
第 3 步。
我添加到 config/routes.yaml
# config/routes.yaml
app.swagger_ui:
path: /api/doc
methods: GET
defaults: { _controller: nelmio_api_doc.controller.swagger_ui }
第 4 步。
我用
nelmio_api_doc:
areas:
path_patterns: # an array of regexps
- ^/api(?!/doc$)
host_patterns:
- ^api\.
之后我应该在 mysite/api/doc 看到 Swagger 的页面
但我在 github 上只看到带有链接“NelmioApiDocBundle”的白页
我做错了什么?
解决方法
我跑了:
MainWindow = fApplication.GetMainWindow(fAutomation,null)?.AsWindow()
现在可以使用了。
,您需要在nelmio_api_doc
中指定区域Delayed(100.millis)(pollStatus(batchId))