3

我正在使用 Slim 框架在 php 中创建一个 Restful api。使用 Swagger-php Annotations 记录 api。如何注释 api 的请求标头?

4

2 回答 2

5

这一定已经改变了,因为现在这对我有用:

@SWG\Parameter(
  type="string",                                                                                                                                                                              
  name="Authorization",
  in="header",
  required=true)

以防万一其他人在这里偶然发现这个。

于 2016-08-23T03:22:26.883 回答
1

检查这个问题

https://github.com/zircote/swagger-php/issues/182

尝试:

@SWG\Parameter(paramType="header", ...)

于 2015-03-12T15:20:06.507 回答