-
-
Notifications
You must be signed in to change notification settings - Fork 840
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
Doc broken with Validator Constraints in FOSRestBundle requirements #357
Comments
I tried to a add a method handleRequirements in Nelmio\ApiDocBundle\Extractor\Handle\FosRestHandler which displayed the pattern if it's a Regex constraint, or the name of the class if it's a Constraint, or the requirements if not. It's not really nice but I don't see another simple way to display useful information.
Example of use in the handle method:
|
Your solution is interesting. Would you mind create a PR? |
Of course. I'm doing it right now! :) |
Oups, I thought the PR would be referenced, not the commit. So here is the PR #365 |
Fix #357 - doc broken with Validator Constraints in FOSRestBundle requirements
I just used a new feature of the FOSRestBundle (FriendsOfSymfony/FOSRestBundle#700). This PR allow to use Constraints from the sf validator as (Query|Request)Param's requirement, not just a string containing the regex. We can now do:
Howewer, there is an issue in the rendering of the doc. A Twig_Error_Runtime exception is thrown in "NelmioApiDocBundle::method.html.twig" at line 71:
I suppose this is due to the fact that requirement is not printable as this is a Constraint. Is this confirmed?
The text was updated successfully, but these errors were encountered: