Closed juliakerschbaummayr1 closed 3 years ago
That's weird. I couldn't reproduce this. Route rules work fine in both the package tests and my machine. Try debugging this further by running in verbose mode and adding some log statements.
I am not sure what you mean, but I ran php artisan scribe:generate --verbose
and copied the output here, hope this helps
As you can see I added @hideFromAPIDocumentation
to a lot of routes to prevent them from showing in the documentation but some are still showing although they donΒ΄t start with api/, for example login, logout, register and so on
The route api/forums/all/{courseId}
is an example of the routes I have two times, in the Forums group and in the general Endpoints group
php artisan scribe:generate --verbose π info Processing route: [GET] sanctum/csrf-cookie π success Processed route: [GET] sanctum/csrf-cookie π info Processing route: [GET] api/user π success Processed route: [GET] api/user π info Processing route: [POST] api/tokens/create π success Processed route: [POST] api/tokens/create π info Processing route: [GET] api/courses π success Processed route: [GET] api/courses π info Processing route: [PUT] api/courses/follow/{id} π success Processed route: [PUT] api/courses/follow/{id} π info Processing route: [GET] api/coaches/all/{courseId} π success Processed route: [GET] api/coaches/all/{courseId} π info Processing route: [GET] api/coaches/{id} π success Processed route: [GET] api/coaches/{id} π info Processing route: [GET] api/forums/all/{courseId} π success Processed route: [GET] api/forums/all/{courseId} π info Processing route: [GET] api/forums/{id} π success Processed route: [GET] api/forums/{id} π info Processing route: [PUT] api/forums/{courseId} π success Processed route: [PUT] api/forums/{courseId} π info Processing route: [GET] api/forums/comments/{id} π success Processed route: [GET] api/forums/comments/{id} π info Processing route: [PUT] api/forums/comments/{id} π success Processed route: [PUT] api/forums/comments/{id} π info Processing route: [GET] api/videos/all/{courseId} π success Processed route: [GET] api/videos/all/{courseId} π info Processing route: [GET] api/videos/{id} π success Processed route: [GET] api/videos/{id} πΈ warning Skipping route: [GET] activate/{user}/{token}: @hideFromAPIDocumentation was specified. π info Processing route: [GET] login π success Processed route: [GET] login πΈ warning Skipping route: [POST] login: @hideFromAPIDocumentation was specified. π info Processing route: [POST] logout π success Processed route: [POST] logout π info Processing route: [GET] register π success Processed route: [GET] register π info Processing route: [POST] register π success Processed route: [POST] register π info Processing route: [GET] password/reset π success Processed route: [GET] password/reset π info Processing route: [POST] password/email π success Processed route: [POST] password/email π info Processing route: [GET] password/reset/{token} π success Processed route: [GET] password/reset/{token} π info Processing route: [POST] password/reset π success Processed route: [POST] password/reset π info Processing route: [GET] / π success Processed route: [GET] / πΈ warning Skipping route: [GET] home: @hideFromAPIDocumentation was specified. πΈ warning Skipping route: [GET] admin/coachings: @hideFromAPIDocumentation was specified. πΈ warning Skipping route: [GET] admin/coachings/create: @hideFromAPIDocumentation was specified. πΈ warning Skipping route: [POST] admin/coachings: @hideFromAPIDocumentation was specified. πΈ warning Skipping route: [GET] admin/coachings/{coaching} - Controller method does not exist. πΈ warning Skipping route: [GET] admin/coachings/{coaching}/edit: @hideFromAPIDocumentation was specified. πΈ warning Skipping route: [PUT,PATCH] admin/coachings/{coaching}: @hideFromAPIDocumentation was specified. πΈ warning Skipping route: [DELETE] admin/coachings/{coaching}: @hideFromAPIDocumentation was specified. πΈ warning Skipping route: [GET] admin/coaching/signout/{attendee}: @hideFromAPIDocumentation was specified. πΈ warning Skipping route: [GET] admin/coaching/cancel/{coaching}: @hideFromAPIDocumentation was specified. π info Processing route: [POST] admin/notifications/{notification}/read π success Processed route: [POST] admin/notifications/{notification}/read π info Processing route: [POST] admin/notifications/read π success Processed route: [POST] admin/notifications/read πΈ warning Skipping route: [GET] admin/forums: @hideFromAPIDocumentation was specified. πΈ warning Skipping route: [GET] admin/forums/create: @hideFromAPIDocumentation was specified. πΈ warning Skipping route: [POST] admin/forums: @hideFromAPIDocumentation was specified. πΈ warning Skipping route: [GET] admin/forums/{forum}: @hideFromAPIDocumentation was specified. πΈ warning Skipping route: [GET] admin/forums/{forum}/edit: @hideFromAPIDocumentation was specified. πΈ warning Skipping route: [PUT,PATCH] admin/forums/{forum}: @hideFromAPIDocumentation was specified. πΈ warning Skipping route: [DELETE] admin/forums/{forum}: @hideFromAPIDocumentation was specified. πΈ warning Skipping route: [POST] admin/forums/{forum}/add/comment: @hideFromAPIDocumentation was specified. π info Processing route: [GET] admin/mailable/{id}/{type} π success Processed route: [GET] admin/mailable/{id}/{type} π info Processing route: [GET] admin/testnotification/{id} π success Processed route: [GET] admin/testnotification/{id} πΈ warning Skipping route: [GET] coaching/coachings: @hideFromAPIDocumentation was specified. πΈ warning Skipping route: [GET] coaching/attend/{coaching}: @hideFromAPIDocumentation was specified. πΈ warning Skipping route: [GET] coaching/info/{coaching}: @hideFromAPIDocumentation was specified. πΈ warning Skipping route: [GET] coaching/signout/{coaching}: @hideFromAPIDocumentation was specified. π info Processing route: [GET] coachings π success Processed route: [GET] coachings π info Processing route: [GET] forum π success Processed route: [GET] forum π info Processing route: [GET] forum/{forum} π success Processed route: [GET] forum/{forum} π info Processing route: [GET] testcrudgenerator CrudGeneratorServiceProvider: OKπ success Processed route: [GET] testcrudgenerator π info Writing source Markdown files to: resources/docs πΈ warning Skipping modified file resources/docs/groups/endpoints.md πΈ warning Skipping modified file resources/docs/index.md πΈ warning Skipping modified file resources/docs/authentication.md π info Wrote source Markdown files to: resources/docs π info Transforming Markdown docs to HTML... π success Wrote HTML documentation to: resources/views/scribe π info Generating Postman collection π success Wrote Postman collection to: storage/app/scribe/collection.json π info Generating OpenAPI specification π success Wrote OpenAPI specification to: storage/app/scribe/openapi.yaml
not sure why but it works now I added Authentication and generated the docs again and now it works, so IΒ΄ll close this issue
What happened? In the scribe.php file at 'routes' => 'match' => 'prefixes' I set the value to ['api/*'] to only show routes from my api in the documentation. But it seems that this value is ignored because all of my routes are showing. I also grouped my endpoints. This works and the different groups are showing, but still some of the routes are showing in the created group and also in the default group Endpoints.
So my two questions are:
My environment:
php -v
): PHP 7.3.25composer show laravel/framework
orcomposer show laravel/lumen-framework
): 8.17.2composer show knuckleswtf/scribe
): 2.5.1My Scribe config (minus the comments):