-
-
Notifications
You must be signed in to change notification settings - Fork 9.2k
don't generate default routes when generating plugin api #5586
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
don't generate default routes when generating plugin api #5586
Conversation
Signed-off-by: Pierre Noël <pierre.noel@strapi.io>
Codecov Report
@@ Coverage Diff @@
## master #5586 +/- ##
=======================================
Coverage 17.50% 17.51%
=======================================
Files 700 700
Lines 10332 10322 -10
Branches 1688 1686 -2
=======================================
- Hits 1809 1808 -1
+ Misses 7090 7083 -7
+ Partials 1433 1431 -2
Continue to review full report at Codecov.
|
Signed-off-by: Pierre Noël <pierre.noel@strapi.io>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
|
This pull request has been mentioned on Strapi Community. There might be relevant details there: https://forum.strapi.io/t/supporting-modular-programming-via-plugin-system/1090/9 |
| name: scope.name, | ||
| }); | ||
| let routes = []; | ||
| if (!scope.args.plugin) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @alexandrebodin & @petersg83, What's the reason for disabling the API routes generation inside plugins? Is there any known issue with it? I've deleted that if (!scope.args.plugin) { locally and it seems to generate/merge existing routes for plugins ok.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As the plugin models don't get auto generated controllers those default routes point to nothing. There was no reason to generate them :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case, it also brokes the functionality of the strapi generate:api order --plugin shop command, which should create a new API inside the plugin, it doesn't generate the routes for it automatically.
|
This pull request has been mentioned on Strapi Community. There might be relevant details there: https://forum.strapi.io/t/supporting-modular-programming-via-plugin-system/1090/11 |
fix #3965