laravel-openapi
laravel-openapi copied to clipboard
Guidance Needed: How to Utilize Vyuldashev\LaravelOpenApi After Setup?
I executed the command as instructed, however, I'm uncertain if it resolved the issue. Moreover, I lack the documentation on utilizing the OpenAPI tag items. Could you provide guidance on their usage?
php artisan openapi:generate
Error
Unknown named parameter $summary
at app/Http/Controllers/MyController.php:12
8▕
9▕ //#[OpenApi\PathItem]
10▕ class MyController extends Controller
11▕ {
➜ 12▕ #[OpenApi\Operation(tags: ['Items'], summary: 'List all items')]
13▕ //#[OpenApi\Operation(tags: ['Items'])]
14▕ public function index()
15▕ {
16▕ $items = Item::all();
+1 vendor frames
2 [internal]:0
Vyuldashev\LaravelOpenApi\RouteInformation::Vyuldashev\LaravelOpenApi\{closure}()
+6 vendor frames
9 [internal]:0
Vyuldashev\LaravelOpenApi\Builders\PathsBuilder::Vyuldashev\LaravelOpenApi\Builders\{closure}()`
The summary and description for Operation will reflect the comments in DocBlock.
https://vyuldashev.github.io/laravel-openapi/paths/operations.html
Unfortunately, a complete list of parameters to specify for the attribute does not seem to be provided. (I also had a hard time at first)
For easy inspection, you can use the hint display in your editor or IDE.
For example, in this screenshot, when you hover over an Operation in VSCode, a list of available parameter names is displayed:
Many parameter names are the same as OAS property names, so this display will help you understand to some extent.
(It seems that summary cannot be specified here)