【发布时间】:2015-11-27 13:48:39
【问题描述】:
我已经为我在 Symfony 中面向 API 的新项目安装了 NelmioApiDocBundle,但我无法摆脱这个捆绑包添加到我所有端点 URL 的 .{_format} 后缀。
看起来是这样的:
我的 API 不支持 _format 作为后缀。它确实支持它作为查询参数或请求标头。因此,如果我尝试从 NelmioApiDocBundle 沙箱向此端点发出请求,它会收到 404 错误响应。
这是我当前关于 nelmio 的 config.yml 部分:
yml
nelmio_api_doc:
name: My API doc
sandbox:
enabled: true
endpoint: null
accept_type: application/json
body_format:
formats: null
default_format: json
request_format:
formats:
json: application/json
xml: null
method: accept_header
default_format: json
authentication:
name: bearer
delivery: query
cache:
enabled: false
file: '%kernel.cache_dir%/api-doc.cache'
【问题讨论】:
标签: symfony nelmioapidocbundle