在我的一个控制器方法中我尝试放置这样的注解:
* @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
,似乎正好适合我的用途,但是我不知道怎么用。
2条答案
按热度按时间vsaztqbk1#
of1yzvn42#
下面的代码解决了这个问题,希望对您有所帮助