Skip to content

Add possibility to add custom non-JSONAPI controllers #86

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

Closed
JanMattner opened this issue Apr 7, 2017 · 2 comments
Closed

Add possibility to add custom non-JSONAPI controllers #86

JanMattner opened this issue Apr 7, 2017 · 2 comments

Comments

@JanMattner
Copy link
Contributor

Currently, via the DasherizedRoutingConvention, all controllers are considered as JSONAPI controllers and the routing convention is applied making it impossible to use that convention besides other non-JSONAPI controllers with custom attribute routing.

It should be possible to explicitly define which controllers are considered as JSONAPI controllers. Easiest way would be a simple attribute that's attached to a controller and the DasherizedRoutingConvention applies the convention only to those controllers with the attribute.

@jaredcnance
Copy link
Contributor

So, I took a quick look at it this morning and i think a slightly better approach would be to just check the controller type. This should work without requiring any changes to the implementation. I'll open a PR with my suggestions.

@JanMattner
Copy link
Contributor Author

Yes, you're right. At first I thought that an attribute would be good as you could use it again to overwrite the default behavior, but actually that does not make sense to overwrite the behavior for some JSONAPI controllers - either all are dasherized or none. So instead we should make it easy to enable or disable the daherized routing convention (e.g. via the JsonApiOptions), but maybe just leave it as is and only change it if there is really a need for it.

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

No branches or pull requests

2 participants