在我的一个控制器方法中,我尝试添加这样的注释:
* @OA\Response(
* response="404",
* description="Invalid field"
* ),
* @OA\Response(
* response="404",
* description="Entity not found"
* )
但现在,当我尝试构建文档时,从openapi收到错误消息:
Warning: Multiple @OA\Response() with the same response="400":
我知道现在在swagger中有一个oneOf
,这似乎正是我想要的。但是,我不知道如何使用它。
发布于 2020-12-03 18:51:53
*@OA\Response(
* response=200,
* description="Successful operation",
* @OA\JsonContent(
* oneOf={
* @OA\Schema(ref="#/components/responses/schema1"),
* @OA\Schema(ref="#/components/responses/schema2"),
* }
* ),
*),
https://stackoverflow.com/questions/60100157
复制相似问题