Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

phpsa
Copy link

@phpsa phpsa commented Jan 7, 2025

using this example docblock:

    /**
     * Flags the policy for automatic renewal
     *
     * @param string $policyId the policy id to flag for renewal
     *
     * @return array{status:bool}
     * @response array{status:true}
     *
     * @throws BadRequestHttpException|NotAcceptableHttpException
     */

to have automated responses mapped over:
image
image

$type->isInstanceOf(LockedHttpException::class) => 423,
$type->isInstanceOf(MethodNotAllowedHttpException::class) => 405,
$type->isInstanceOf(NotAcceptableHttpException::class) => 406,
$type->isInstanceOf(NotFoundHttpException::class) => 404,
Copy link
Member

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

@romalytvynenko romalytvynenko changed the title fix: Symfony\Component\HttpKernel\Exception\ types Added support for Symfony\Component\HttpKernel\Exception\* documentation when annotated in exceptions Jan 8, 2025
@romalytvynenko
Copy link
Member

romalytvynenko commented Jan 8, 2025

@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

@phpsa
Copy link
Author

phpsa commented Jan 16, 2025

@romalytvynenko - thanks for the feedback,
have removed NotFound and added a test to confirm they are pickedup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants