-
Notifications
You must be signed in to change notification settings - Fork 138
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
Added support for Symfony\Component\HttpKernel\Exception\*
documentation when annotated in exceptions
#674
Conversation
$type->isInstanceOf(LockedHttpException::class) => 423, | ||
$type->isInstanceOf(MethodNotAllowedHttpException::class) => 405, | ||
$type->isInstanceOf(NotAcceptableHttpException::class) => 406, | ||
$type->isInstanceOf(NotFoundHttpException::class) => 404, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NotFoundHttpException
is handled in other extension, please make sure to handle it in a single extension
Symfony\Component\HttpKernel\Exception\*
documentation when annotated in exceptions
@phpsa good idea! Let's just make sure we don't handle the same exceptions types in different extensions and I'm happy to merge. Thank you! Oh, almost forgot. Please also include some tests |
@romalytvynenko - thanks for the feedback, |
@phpsa made some changes before merging. The main difference is that in your PR you documented ANY exception as 500 response. I'd prefer not do that – not documenting the response is better that documenting it in a wrong way (some exceptions MAY be renderable and there a custom status MAY be used). Other than that – thanks for the contribution and sorry it took long to get to it. |
using this example docblock:
to have automated responses mapped over:
![image](https://private-user-images.githubusercontent.com/952595/400924571-5aeaaa3b-3d91-4560-bc77-9c178d57d476.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk5NjY1NDAsIm5iZiI6MTczOTk2NjI0MCwicGF0aCI6Ii85NTI1OTUvNDAwOTI0NTcxLTVhZWFhYTNiLTNkOTEtNDU2MC1iYzc3LTljMTc4ZDU3ZDQ3Ni5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1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