-
Notifications
You must be signed in to change notification settings - Fork 703
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
Resource Pluralization as an option. #294
Comments
+1 Can be very handy in my situation where every resource has one name, not a plural and singular one. Just one singular name, like the name for an entity. |
i think if at all pluralization needs to be disabled only on the resource level, since otherwise it can cause incompatibilities between Bundles expecting the option to be on or off. |
@lsmith77 could you provide pointers to how this should be implemented as part of the RouteResource annotation? |
look at the annotation class and add another property. this will result in having another attribute to set in the annotation |
Ok, I tried that. I got quite far, but my unittests fail with the error: Doctrine\Common\Annotations\AnnotationException: [Syntax Error] Expected Value, got 'r' at position 31 in class FOS\RestBundle\Tests\Fixtures\Controller\AnnotatedNonPlurlizedArticleController. Here's the value I tried: /**
* @Rest\RouteResource("Article", false)
*/
class AnnotatedNonPlurlizedArticleController extends FosRestController And the Annotation definition: /**
* RouteResource annotation class.
* @Annotation
* @Target("CLASS")
*/
class RouteResource
{
/**
* @var string required
*/
public $resource;
/**
* @var boolean
*/
public $pluralize = false;
} |
can you just open a PR with your work? makes reviewing easier. |
I'll do that tomorrow. |
This issue/PR seems to be abandoned ... I will continue this work in a new PR. |
closed via #1096 |
Hi,
Actually, routing use pluralization automatically for resources. What do you think about an option to be able to deactivate that ? For sure, by default it'll be activated ...
It could be defined on config:
And even on RouteResource annotation ?
The text was updated successfully, but these errors were encountered: