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

duplicated routes #716

Closed
joanteixi opened this issue Mar 19, 2014 · 5 comments
Closed

duplicated routes #716

joanteixi opened this issue Mar 19, 2014 · 5 comments

Comments

@joanteixi
Copy link

I'm not sure if i'm doing something wrong, but when I define a resource as rest type, and also in some of the controllers, override the default routing configuration and add routing annotations, the router:debug show duplicate routes with prefix and without prefix.

some example:

search:
    type:     rest
    prefix:   /api/v2
    resource: Onfan\ApiBundle\Controller\SearchController
    options:
        i18n: false

In searchController, I add some annotations:

 /**
   * @Get("searchExternal", name="_myname")
   *
   */
   public function getSearchExternalAction(Request $request)

In console, router:debug |grep searchExternal shows:

_myname                  GET      ANY    ANY  /searchExternal
get_search_external_v4   GET      ANY    ANY  /api/v2/searchExternal.{_format}

(I add options, i18n false, but adding also the route name begging with _ so the i18nRoutingBundle skip to process it).

It's some kind of bug or i'm doing something wrong?

Thanks,

Joan Teixidó

@lsmith77
Copy link
Member

could you have a look at the test suite and see if you can replicate your issue by adding a test?

@lsmith77
Copy link
Member

ping .. also please check if the issue still exists .. there were some recent changes in this part of the Bundle.

see #715, #732

@joanteixi
Copy link
Author

I'm trying to create new symfony project from scratch to reproduce this bug and I can't reproduce yet.
I will close this issue until get more clues.

Anyway, with the last change in this repo, I get the same routes duplicated.

@hd-deman
Copy link
Contributor

yes. its fixed by #732

@feridmovsumov
Copy link
Contributor

I have the same problem.

I added custom route for count action

brands_count:
    pattern:  /brands/count.{_format}
    defaults: { _controller: ApiBundle:Brand:getCount, _format: json }
    methods:  [GET]

and when I run php console debug:route

brands_count GET    ANY    ANY  /api/v2/brands/count.{_format}
get_count  GET    ANY    ANY  /api/v2/count.{_format}

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

No branches or pull requests

4 participants