Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guidance Needed: How to Utilize Vyuldashev\LaravelOpenApi After Setup? #114

Open
wgtgithub opened this issue Apr 30, 2024 · 1 comment
Open

Comments

@wgtgithub
Copy link

wgtgithub commented Apr 30, 2024

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}()`
@KentarouTakeda
Copy link

The summary and description for Operation will reflect the comments in DocBlock.

https://vyuldashev.github.io/laravel-openapi/paths/operations.html
Operations

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:

VSCode-Display

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants