Use controller_path() when possible in order to deal with namespaced controller
There is a syntax error in this PR. Also, there are usecases where controller_name makes more sence (like versioning, see #75), I can imagine this being a contiguration option. Something like config.namespaced_resources or something like that…
Sorry for the typo, I actually aliased controller_name to controller_path for my use case and I wrote this PR a bit quickly.
I do not understand why versioning might be a problem , can't we have routes like
api :GET, "/api/users/"
api :GET, "/api/namespaced/users/"
being documented as
I understand you use case, but there are others:
users can use modules for versions. Here is an example . In this example, they use most of the v1 controllers for the v2 as well, and in v2 modules are only changed things (which makes tons of sence to prevent code copying). However, if we used controller_path in this example, the path would look like
and once the users resource was changed for v2, it would change to /apipie/2/v2/users, which is not what we want. We want see what the resource looks like in specified version, not caring what namespace it's defined in.
Therefore I'm in for making it an optional change. but chaning it for all users is not what we want.
 - https://github.com/theforeman/foreman/tree/develop/app/controllers/api
That make perfect sense, thanks for your clear explanation :)
I'll try to come with a less intrusive approach for namespaced controllers