What is the difference between creating a Rest plugin with the Rest API and creating a route/controller that returns a jsonResponse ?
In which case i have to create a custom route/controller with a jsonResponse ?
Drupal Answers is a question and answer site for Drupal developers and administrators. It only takes a minute to sign up.Sign up to join this community
The main difference is the authentication and authorization, is Rest Solution you should provide different way to authentication and authorization to access to the endpoint. but in Controller,route solution is MVC base solution that drupal and it's ACL ( role and permissions) hanle the access to the results not REST authorization methods like basic_auth, oauth2 etc.