L5-Swagger
L5-Swagger copied to clipboard
Specify Two Responses with the Same Response Code
- L5-Swagger Version: 8.6
- PHP Version 8.1
- OS: N.A.
Description
I have some endpoints that return different bodies for the same response code. Specifically, when the status code is 400, I want to return different responses with an internal code, a message, and details.
@OA\Response( response=400, description="Authorization empty",
* @OA\JsonContent(
* @OA\Property( property="code", type="integer", example=4001 ),
* @OA\Property( property="message", type="string", example="Bad request" ),
* @OA\Property( property="details", type="string", example="Authorization empty" ),
* ),
* ),
I have seen in this link that schemas can be defined in OpenAPI 2.0, but I don't see how to do it with L5-Swagger. Link