You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I'm currently laravel-swagger to auto-generate my api endpoints. I want to filter only "API" endpoints will be create in the .json file. the code I've tried to run:
my colleague tried to replicate this library and make it function with filter. he was able to make it work. I'm not sure why in my local machine --filter is not working.
and also in addition with my question. how to add POST, DELETE and UPDATE/PATCH parameters?
Not sure if this is the issue but it looks like you're passing the filter after the output redirect, you should pass the filter to the command php artisan laravel-swagger:generate --filter="/api" > public/swagger.json, also use the latest possible version of the library. As for the parameters: the command automatically generates it depending how your application is structured. For body parameters, it will parse injected FormRequested classes in your controllers and generate them based on it's best guess as to how your rules look. It can't generate these if you're using the validator in the method body since php's reflection doesn't have access to these. For path parameters it will scan your routes and look for any variables in the route and generate them based on the name. Feel free to reopen if you're still facing issues.
Hello, I'm currently laravel-swagger to auto-generate my api endpoints. I want to filter only "API" endpoints will be create in the .json file. the code I've tried to run:
php artisan laravel-swagger:generate > public/swagger.json --filter="/api"
Its not working and returns NULL
{
"swagger": "2.0",
"info": {
"title": null,
"description": "",
"version": "1.0.0"
},
"host": null,
"basePath": "/",
"paths": []
}
image below is my api routes file
The text was updated successfully, but these errors were encountered: