-
-
Notifications
You must be signed in to change notification settings - Fork 390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple @OA\Response() with the same response="200": #350
Comments
@bfanger any solution to this ? |
From the screenshot, I see that this is an issue in |
You can only have one "responses":{
"200": {
// ...
}
} The schema inside the 200 response can contain multiple schema's using oneOf |
@bfanger I have only one response of 200 and this is format for all of my methods inside controller but it's working on local and giving error on server. |
swagger-php detects 2 one for Extra weird that it only happens on the server, not locally. (version differences?) |
This is only happens on server and it's breaking the others api endpoints... This is doesn't make any sense, why my api's cannot have multiples 200 responses? |
@Messhias Because of the openapi json structure. "responses": {
"200": {
"description": "Doing stuff",
"content": {
"application/json": {
"schema": You can't add another "200" key, therefore you can't have multiple 200 responses. swagger/openapi only creates (interactive) documentation, so I can't "break" any endpoints, at worst the implementation doesn't match the generated documentation. |
is anybody got solution cause i am having same problem |
All caps gives you headache, use @OA\Get instead of @OA\GET. You may visit this issue for solution reference. |
This resolves the issue, thank you @nythzville ! |
You can merge this? |
Closing due to no activity for a very long time |
Top... It helped me a lot. It cost! |
If you are using any route definition in attributions/annotations, then you might be missing path definition, which causes OA\Response to point to the same request. |
Description: I'm facing this issue when generating docs. On my local this is working fine but I get an exception on server.
Steps To Reproduce:
php artisan l5-swagger:generate
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: