Lomkit / laravel-rest-api

Generate Api in seconds
https://laravel-rest-api.lomkit.com/
MIT License
444 stars 25 forks source link

Fixed wrong matching. Changed match detail to details for working openAPI #85

Closed Nowocyn closed 10 months ago

Nowocyn commented 10 months ago

There was a missing "s" inside of the OpenAPI generatePaths function.

The function tried to match the string 'detail' but it never appeared with the default route names via Rest::resource('users', UsersController::class);

php artisan route:list ->

GET|HEAD  api/v1/users ... api.v1.users.details › App\Rest\Controllers\UsersController@details
  DELETE    api/v1/users ... api.v1.users.destroy › App\Rest\Controllers\UsersController@destroy
  POST      api/v1/users/actions/{action} ... api.v1.users.operate › App\Rest\Controllers\UsersController@operate
  POST      api/v1/users/mutate ... api.v1.users.mutate › App\Rest\Controllers\UsersController@mutate
  POST      api/v1/users/search ... api.v1.users.search › App\Rest\Controllers\UsersController@search

Before fix: image

After fix: image

I also added a space after the url inside the rest:documentation command info.

GautierDele commented 10 months ago

Hello @Nowocyn,

Thanks for your MR, merging !