Closed gandra closed 7 years ago
Hey :).
Did you add the ServiceProvider correctly? Seems like you missed to add ::class within the app.php config file.
You have to add Jlapp\Swaggervel\SwaggervelServiceProvider::class, to the app.php.
Update: I modified the README file, because the ::class was missing in there, too.
Thanks!
I had did it all from beginning and now works. In your docs should be addedd following line at the beggining for the installation:
composer require "appointer/Swaggervel" --dev
I had played with different swagger packages and somehow was in inconsistent state. I have a problem to find decent swagger package for laravel. Can you help me to make some API documentation where will be demonstrated all relevant API docs:
I have created demo project for this purpose: https://github.com/gandra/appointer-swaggervel-laravel-demo/blob/master/app/Http/Controllers/Api/AnimalsController.php
Hey, i added the line to the readme file.
Yeah, finding good examples really is not that easy - I had to figure everything out by myself. Maybe I have time to throw in some examples. Thanks for the input!
By the way: It seems that i don't have access to the file you linked :(.
Sorry man, I have put wrong link ... indeed namespace api was wrongly commited as app ... try it again https://github.com/gandra/appointer-swaggervel-laravel-demo/blob/master/app/Http/Controllers/Api/AnimalsController.php
I attached several examples from an existing project of mine. Maybe this is helpful to you.
Thanks man!
If you find time can you add some examples regarding to security and authentication?
For example where I could add SecurityScheme annotation to be used in all other parts of app?
* @SWG\SecurityScheme(
* securityDefinition="api_key",
* type="apiKey",
* in="header",
* name="api_key"
* )
*
* @SWG\SecurityScheme(
* securityDefinition="myapp_auth",
* type="oauth2",
* authorizationUrl="http://my.url.com/oauth/dialog",
* flow="implicit",
* scopes={
* "read:data": "read data",
* "write:data": "modify data"
* }
* )
Maybe in some parent controller?
And is it possible to add multiple schemes for the same project?
In my case i added them in the Controller.php - the Class that is extended by all Controllers within me application. But you could also create a new .php file to place the annotations in there - php-swagger just scans your whole directory with all files in it - doesn't matter where you actually place the annotations.
Thanks!
Running
php artisan vendor:publish
fails with error:I am using laravel 5.3 and php 7.1 on windows 7.