Jac*_*ian 7 php swagger openapi
在我的控制器方法之一中,我尝试添加这样的注释:
* @OA\Response(
* response="404",
* description="Invalid field"
* ),
* @OA\Response(
* response="404",
* description="Entity not found"
* )
Run Code Online (Sandbox Code Playgroud)
但现在当我尝试构建文档时,我从 openapi 收到一条错误消息:
Warning: Multiple @OA\Response() with the same response="400":
Run Code Online (Sandbox Code Playgroud)
我知道现在有一个oneOf大摇大摆的出现,看来正是为了我的目的。但是,我不知道如何使用它。
小智 2
*@OA\Response(
* response=200,
* description="Successful operation",
* @OA\JsonContent(
* oneOf={
* @OA\Schema(ref="#/components/responses/schema1"),
* @OA\Schema(ref="#/components/responses/schema2"),
* }
* ),
*),
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3744 次 |
| 最近记录: |