Comments (4)
Hey @benpetty!
Thank you! This makes sense, I will fix.
🙌
from scramble.
I have a similar error using Route::apiResources
where my routes look like:
GET|HEAD api/accounts ................. accounts.index › Api\Accounts\AccountsController@index
POST api/accounts ................. accounts.store › Api\Accounts\AccountsController@store
GET|HEAD api/accounts/{account} ......... accounts.show › Api\Accounts\AccountsController@show
PUT|PATCH api/accounts/{account} ..... accounts.update › Api\Accounts\AccountsController@update
DELETE api/accounts/{account} ... accounts.destroy › Api\Accounts\AccountsController@destroy
But scramble generated paths are:
GET http://localhost/api/accounts
POST http://localhost/api/accounts
GET http://localhost/api/ids/{id}
PUT http://localhost/api/ids/{id}
DELETE http://localhost/api/ids/{id}
As you can see the first two GET
& POST
routes are correct but the ones that accept a parameter in the URL are incorrect.
routes/api.php
Route::apiResources([
'accounts' => AccountsController::class,
// ...other resources
]);
app/Http/Controllers/Api/Accounts/AccountsController.php
class AccountsController extends Controller
{
public function index()
{
// list method...
}
public function store(AccountRequest $request)
{
// create method...
}
public function show($id)
{
// view method...
}
public function update(AccountRequest $request, $id)
{
// update method...
}
public function destroy($id)
{
// delete method...
}
}
bug is affecting all resources with the same pattern...
from scramble.
@Jesper-FIltenborg-Dwarf can you also show your's controller's method?
Thanks.
from scramble.
I changed the argument name in the controller method from $id
to $showFunctionArgumentName
the path changed to this
from scramble.
Related Issues (20)
- Add a simple way to hide an endpoint from documentation using annotation
- Rule::enum doesn't take into consideration additional params
- Default value for query parameters seem to be not preferred HOT 2
- Form request properties with dot notation are duplicated by Scramble HOT 1
- [documentation] wrong annotation for paginated responses HOT 6
- Undefined variable when using array validation and variables. HOT 2
- Request body is empty for every request HOT 3
- No detection of return type HOT 5
- No hints are displayed when merging requests HOT 7
- Path parameter name is wrong
- Spatie laravel data rules inferring not working HOT 2
- Wrong Attribute Margining on Response Example HOT 2
- Allow to explicitly name a schema (originating from a class)
- Getting validation rules thru function gives error HOT 1
- Mistake in Docs - Security HOT 2
- FormRequest are not begin parsed anymore since version 11.0 HOT 3
- Issue while using wrap within a JsonResource with same key as within the array
- Invisible color scheme for request body HOT 4
- Generated responses are not visible in docs/api HOT 1
- multiple api HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scramble.