Giter Site home page Giter Site logo

darkaonline / l5-swagger Goto Github PK

View Code? Open in Web Editor NEW
2.5K 38.0 387.0 1.73 MB

OpenApi or Swagger integration to Laravel

Home Page: https://github.com/DarkaOnLine/L5-Swagger

License: MIT License

PHP 94.13% Blade 3.22% Dockerfile 2.65%
laravel laravel-5-package l5-swagger swagger-php swagger-ui swagger openapi documentation specification swagger-specification

l5-swagger's People

Contributors

13338 avatar ashish-khokhar avatar bbs-smuller avatar collegeman avatar darkaonline avatar fh-jashmore avatar firdaushatta avatar gruz avatar hackel avatar jonezzyboy avatar jpuck avatar liambull avatar markokeeffe avatar matriphe avatar maurob45 avatar mfrancois avatar pataar avatar paulhuisman avatar pouriaseyfi avatar rlems avatar rodrigowbazevedo avatar sserbin avatar stefanullrich avatar stylecibot avatar thedoctor0 avatar tomcastleman avatar vaawebdev avatar verwilst avatar vrajroham avatar ymhuang0808 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

l5-swagger's Issues

Support for Dingo API ?

Hi,

I'm trying to use L5-Swagger with dingo api package:

https://github.com/dingo/api

But whenever I run php artisan l5-swagger:generate, the results are not printed in /api/documentation path..

Any plans for supporting Dingo API ? Any ideas on how to get it to work ?

Thanks a lot !

ErrorException

Hi,

i'm using laravel 5.3 with passport apis, when I tried this command php artisan l5-swagger:generate
i found error down blow "l5-swagger:publis" runed
[ErrorException]
Required @swg\Info() not found

Can not view api document

Hi i am on laravel 5.4

i ran
l5-swagger:generate
l5-swagger:publish

when i open browser with link http://xxx.local:8000/api/documentation

i see in console log , not sure what is wrong

"NetworkError: 500 Internal Server Error - http://xxx.local:8000/docs/asset/swagger-ui-standalone-preset.js"
swagger...eset.js
"NetworkError: 500 Internal Server Error - http://xxx.local:8000/docs/asset/swagger-ui-bundle.js"
swagger...ndle.js
"NetworkError: 500 Internal Server Error - http://xxx.local:8000/docs/asset/swagger-ui-standalone-preset.js"

then i tried to run

l5-swagger:publish-assets
then got this

[Symfony\Component\Console\Exception\CommandNotFoundException]
Command "l5-swagger:publish-assets" is not defined.
Did you mean one of these?
l5-swagger:generate
l5-swagger:publish
l5-swagger:publish-config
l5-swagger:publish-views

CORS issue on live site

I'm able to load the documentation for my API with no issues locally using http, but it doesn't work on heroku using https. I've struggled with CORS for quite some time, so I'm not surprised at this and I'm also not even sure it's l5-swagger causing the problem, but I figured I'd start here given what I'm seeing.

I have the routes setup as /documentation and /docs in config/l5-swagger.php. Going to /documentation loads the page and all documentation as expected locally. This is what happens when I navigate to my documentation page on Heroku over https:

image

I don't understand why the link is set to http. I've looked through my code for a long time and I can't figure out where that url is generated. I see a PHP variable called $urlToDocs. The page loads just fine if I use the CORS chrome plugin:

2016-10-25_23-34-07

route:cache

Hi,
The route:cache artisan command does not work, looks like the reason is the docs route.

Auth token

Is it possible to set auth token via custom header. For example to send api auth token as X-Auth-Header?

Possible to use oauth2 password flow for Try button?

I'm confused about how to implement the Try button with the Oauth2 password flow. Actually, I can't get the button to work with any Oauth2 flow, but password is the one I'd like to use. I've been searching online for a while and I found a link that kinda says how to do it, but it lacks most of the relevant information to actually tell someone how to make it work (like usual... people always post the minimal amount of info and expect everyone to already understand... /sigh).

I've looked in config/l5-swagger.php and I can't find any settings in there related to Oauth2. I see the api_key field, but I don't really know what to do with that either or if there's a way to use that. The Try button works with endpoints that don't need a token, so I know my documentation and API are functioning correctly up to that point.

Any tips would be greatly appreciated.

Laravel 5.3 new routes folder structure not in ./app/

Hi, In L5.3 the routes are no longer in ./app/Http/... but a new ./routes folder. I have some documentation in those routes that do not get picked up now and I was wondering what the best approach was to address this. Would it be better to turn the list of scanned folders into an array? ['app','routes'] and loop through? Or is there some other thing im missing? I really like the convenience of route cohabitation with SWG properties. Thanks!

Doesn't work with Laravel 5.1

Seems like minimum requirement for this package is set to 5.2 where as in packagist is saying it's compatible with 5.1, will you be able to support LR5.1

Problem 1
- darkaonline/l5-swagger 3.1.1 requires laravel/framework 5.2.* -> satisfiable by laravel/framework[5.2.x-dev, v5.2.0, v5.2.0-beta1, v5.2.1, v5.2.10, v5.2.11, v5.2.12, v5.2.13, v5.2.14, v5.2.15, v5.2.16, v5.2.17, v5.2.18, v5.2.19, v5.2.2, v5.2.20, v5.2.21, v5.2.22, v5.2.23, v5.2.24, v5.2.25, v5.2.26, v5.2.27, v5.2.28, v5.2.29, v5.2.3, v5.2.30, v5.2.31, v5.2.32, v5.2.33, v5.2.34, v5.2.35, v5.2.36, v5.2.37, v5.2.38, v5.2.39, v5.2.4, v5.2.5, v5.2.6, v5.2.7, v5.2.8, v5.2.9] but these conflict with your requirements or minimum-stability.
- darkaonline/l5-swagger 3.1 requires laravel/framework 5.2.* -> satisfiable by laravel/framework[5.2.x-dev, v5.2.0, v5.2.0-beta1, v5.2.1, v5.2.10, v5.2.11, v5.2.12, v5.2.13, v5.2.14, v5.2.15, v5.2.16, v5.2.17, v5.2.18, v5.2.19, v5.2.2, v5.2.20, v5.2.21, v5.2.22, v5.2.23, v5.2.24, v5.2.25, v5.2.26, v5.2.27, v5.2.28, v5.2.29, v5.2.3, v5.2.30, v5.2.31, v5.2.32, v5.2.33, v5.2.34, v5.2.35, v5.2.36, v5.2.37, v5.2.38, v5.2.39, v5.2.4, v5.2.5, v5.2.6, v5.2.7, v5.2.8, v5.2.9] but these conflict with your requirements or minimum-stability.
- darkaonline/l5-swagger 3.0.1 requires laravel/framework 5.2.* -> satisfiable by laravel/framework[5.2.x-dev, v5.2.0, v5.2.0-beta1, v5.2.1, v5.2.10, v5.2.11, v5.2.12, v5.2.13, v5.2.14, v5.2.15, v5.2.16, v5.2.17, v5.2.18, v5.2.19, v5.2.2, v5.2.20, v5.2.21, v5.2.22, v5.2.23, v5.2.24, v5.2.25, v5.2.26, v5.2.27, v5.2.28, v5.2.29, v5.2.3, v5.2.30, v5.2.31, v5.2.32, v5.2.33, v5.2.34, v5.2.35, v5.2.36, v5.2.37, v5.2.38, v5.2.39, v5.2.4, v5.2.5, v5.2.6, v5.2.7, v5.2.8, v5.2.9] but these conflict with your requirements or minimum-stability.
- darkaonline/l5-swagger 3.0 requires laravel/framework 5.2.* -> satisfiable by laravel/framework[5.2.x-dev, v5.2.0, v5.2.0-beta1, v5.2.1, v5.2.10, v5.2.11, v5.2.12, v5.2.13, v5.2.14, v5.2.15, v5.2.16, v5.2.17, v5.2.18, v5.2.19, v5.2.2, v5.2.20, v5.2.21, v5.2.22, v5.2.23, v5.2.24, v5.2.25, v5.2.26, v5.2.27, v5.2.28, v5.2.29, v5.2.3, v5.2.30, v5.2.31, v5.2.32, v5.2.33, v5.2.34, v5.2.35, v5.2.36, v5.2.37, v5.2.38, v5.2.39, v5.2.4, v5.2.5, v5.2.6, v5.2.7, v5.2.8, v5.2.9] but these conflict with your requirements or minimum-stability.
- Installation request for darkaonline/l5-swagger ~3.0 -> satisfiable by darkaonline/l5-swagger[3.0, 3.0.1, 3.1, 3.1.1].

{!! !!} Quest

In the index.blade.php
What is then "{!! !!}"

            var url = window.location.search.match(/url=([^&]+)/);
            if (url && url.length > 1) {
                url = decodeURIComponent(url[1]);
            } else {
                url = "{!! $urlToDocs !!}";
            }

External Documentation for single path not rendered correctly

Library version : 3.1.4 (I'm using laravel 5.2)

I have this

     * @SWG\Get(
     *     path="/google/event",
     *     tags={"googleEvent"},
     *     operationId="event.index",
     *     summary="list google events",
     *     description="Listing of Google Events.",
     *     consumes={"application/json", "application/x-www-form-urlencoded"},
     *     produces={"application/json"},
     *     @SWG\ExternalDocumentation(
     *         description="More info",
     *         url="https://developers.google.com/google-apps/calendar/v3/reference/events"
     *     ),
     *     @SWG\Parameter(
     *         name="email",
     *         in="query",
     *         description="Email of google account",
     *         type="string"
     *     ),
     *     @SWG\Parameter(
     *         name="calendarId",
     *         in="query",
     *         description="Calendar id of calendar to filter event",
     *         type="string"
     *     ),
     *     @SWG\Parameter(
     *         name="pageToken",
     *         in="query",
     *         description="",
     *         type="string"
     *     ),
     *     @SWG\Parameter(
     *         name="syncToken",
     *         in="query",
     *         description="Token obtained from the nextSyncToken field",
     *         type="string"
     *     ),
     *     @SWG\Parameter(
     *         name="timeMax",
     *         in="query",
     *         description="Time max to filter",
     *         type="string"
     *     ),
     *     @SWG\Parameter(
     *         name="timeMin",
     *         in="query",
     *         description="Time min to filter",
     *         type="string"
     *     ),
     *     @SWG\Response(
     *         response=200,
     *         description="OK",
     *         @SWG\Schema(ref="#/definitions/GoogleEventResponsePaged")
     *     ),
     *     @SWG\Response(
     *         response=500,
     *         description="Server Error",
     *     ),
     *     @SWG\Response(
     *         response=400,
     *         description="Bad Request",
     *     ),
     *     security={
     *       {"apiKey": {}},
     *     }
     * )

Json result:

        "/google/event": {
            "get": {
                "tags": [
                    "googleEvent"
                ],
                "summary": "list google events",
                "description": "Listing of Google Events.",
                "externalDocs": {
                    "description": "More info",
                    "url": "https://developers.google.com/google-apps/calendar/v3/reference/events"
                },
                "operationId": "event.index",
                "consumes": [
                    "application/json",
                    "application/x-www-form-urlencoded"
                ],
                "produces": [
                    "application/json"
                ],
                "parameters": [
                    {
                        "name": "email",
                        "in": "query",
                        "description": "Email of google account",
                        "type": "string"
                    },
                    {
                        "name": "calendarId",
                        "in": "query",
                        "description": "Calendar id of calendar to filter event",
                        "type": "string"
                    },
                    {
                        "name": "pageToken",
                        "in": "query",
                        "description": "",
                        "type": "string"
                    },
                    {
                        "name": "syncToken",
                        "in": "query",
                        "description": "Token obtained from the nextSyncToken field",
                        "type": "string"
                    },
                    {
                        "name": "timeMax",
                        "in": "query",
                        "description": "Time max to filter",
                        "type": "string"
                    },
                    {
                        "name": "timeMin",
                        "in": "query",
                        "description": "Time min to filter",
                        "type": "string"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/GoogleEventResponsePaged"
                        }
                    },
                    "500": {
                        "description": "Server Error"
                    },
                    "400": {
                        "description": "Bad Request"
                    }
                },
                "security": [
                    {
                        "apiKey": []
                    }
                ]
            },

In Swagger online editor, external documentation link is correctly displayed.

screen shot 2017-04-02 at 6 42 17 pm

While documentation from L5-Swagger don't have external documentation link.

screen shot 2017-04-02 at 6 46 04 pm

screen shot 2017-04-02 at 6 46 29 pm

Class web does not exist on v3.2.2

I'm using Laravel 5.1 and just updated package to latest 3.2.2 release. I'm using Dingo package for the API part but it hasn't have to with it this issue I'm seeing right now.

/api/documentation and /api/docs - the two routes return an error now.

I don't know if it's the right solution but I think the middleware group web does not exist in 5.1 so this needs to be removed in config/l5-swagger.php or might as well create this middleware group manually.

Debug trace:

{
  "message": "Class web does not exist",
  "code": -1,
  "status_code": 500,
  "debug": {
    "line": 741,
    "file": "/Users/dorelljames/testproject/vendor/laravel/framework/src/Illuminate/Container/Container.php",
    "class": "ReflectionException",
    "trace": [
      "#0 /Users/dorelljames/testproject/vendor/laravel/framework/src/Illuminate/Container/Container.php(741): ReflectionClass->__construct('web')",
      "#1 /Users/dorelljames/testproject/vendor/laravel/framework/src/Illuminate/Container/Container.php(631): Illuminate\\Container\\Container->build('web', Array)",
      "#2 /Users/dorelljames/testproject/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(674): Illuminate\\Container\\Container->make('web', Array)",
      "#3 /Users/dorelljames/testproject/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(123): Illuminate\\Foundation\\Application->make('web')",
      "#4 [internal function]: Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Dingo\\Api\\Http\\Request))",
      "#5 /Users/dorelljames/testproject/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): call_user_func(Object(Closure), Object(Dingo\\Api\\Http\\Request))",
      "#6 /Users/dorelljames/testproject/vendor/laravel/framework/src/Illuminate/Routing/Router.php(710): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))",
      "#7 /Users/dorelljames/testproject/vendor/laravel/framework/src/Illuminate/Routing/Router.php(673): Illuminate\\Routing\\Router->runRouteWithinStack(Object(Illuminate\\Routing\\Route), Object(Dingo\\Api\\Http\\Request))",
      "#8 /Users/dorelljames/testproject/vendor/laravel/framework/src/Illuminate/Routing/Router.php(635): Illuminate\\Routing\\Router->dispatchToRoute(Object(Dingo\\Api\\Http\\Request))",
      "#9 /Users/dorelljames/testproject/vendor/dingo/api/src/Routing/Adapter/Laravel.php(81): Illuminate\\Routing\\Router->dispatch(Object(Dingo\\Api\\Http\\Request))",
      "#10 /Users/dorelljames/testproject/vendor/dingo/api/src/Routing/Router.php(513): Dingo\\Api\\Routing\\Adapter\\Laravel->dispatch(Object(Dingo\\Api\\Http\\Request), 'v1')",
      "#11 /Users/dorelljames/testproject/vendor/dingo/api/src/Http/Middleware/Request.php(126): Dingo\\Api\\Routing\\Router->dispatch(Object(Dingo\\Api\\Http\\Request))",
      "#12 [internal function]: Dingo\\Api\\Http\\Middleware\\Request->Dingo\\Api\\Http\\Middleware\\{closure}(Object(Dingo\\Api\\Http\\Request))",
      "#13 /Users/dorelljames/testproject/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(139): call_user_func(Object(Closure), Object(Dingo\\Api\\Http\\Request))",
      "#14 /Users/dorelljames/testproject/vendor/barryvdh/laravel-debugbar/src/Middleware/Debugbar.php(51): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Dingo\\Api\\Http\\Request))",
      "#15 [internal function]: Barryvdh\\Debugbar\\Middleware\\Debugbar->handle(Object(Dingo\\Api\\Http\\Request), Object(Closure))",
      "#16 /Users/dorelljames/testproject/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)",
      "#17 /Users/dorelljames/testproject/vendor/barryvdh/laravel-cors/src/HandleCors.php(34): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Dingo\\Api\\Http\\Request))",
      "#18 [internal function]: Barryvdh\\Cors\\HandleCors->handle(Object(Dingo\\Api\\Http\\Request), Object(Closure))",
      "#19 /Users/dorelljames/testproject/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)",
      "#20 /Users/dorelljames/testproject/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(50): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Dingo\\Api\\Http\\Request))",
      "#21 [internal function]: Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->handle(Object(Dingo\\Api\\Http\\Request), Object(Closure))",
      "#22 /Users/dorelljames/testproject/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)",
      "#23 /Users/dorelljames/testproject/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Dingo\\Api\\Http\\Request))",
      "#24 [internal function]: Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle(Object(Dingo\\Api\\Http\\Request), Object(Closure))",
      "#25 /Users/dorelljames/testproject/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)",
      "#26 /Users/dorelljames/testproject/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(62): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Dingo\\Api\\Http\\Request))",
      "#27 [internal function]: Illuminate\\Session\\Middleware\\StartSession->handle(Object(Dingo\\Api\\Http\\Request), Object(Closure))",
      "#28 /Users/dorelljames/testproject/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)",
      "#29 /Users/dorelljames/testproject/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Dingo\\Api\\Http\\Request))",
      "#30 [internal function]: Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse->handle(Object(Dingo\\Api\\Http\\Request), Object(Closure))",
      "#31 /Users/dorelljames/testproject/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)",
      "#32 /Users/dorelljames/testproject/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(59): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Dingo\\Api\\Http\\Request))",
      "#33 [internal function]: Illuminate\\Cookie\\Middleware\\EncryptCookies->handle(Object(Dingo\\Api\\Http\\Request), Object(Closure))",
      "#34 /Users/dorelljames/testproject/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)",
      "#35 /Users/dorelljames/testproject/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(44): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Dingo\\Api\\Http\\Request))",
      "#36 [internal function]: Illuminate\\Foundation\\Http\\Middleware\\CheckForMaintenanceMode->handle(Object(Dingo\\Api\\Http\\Request), Object(Closure))",
      "#37 /Users/dorelljames/testproject/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)",
      "#38 [internal function]: Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Dingo\\Api\\Http\\Request))",
      "#39 /Users/dorelljames/testproject/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): call_user_func(Object(Closure), Object(Dingo\\Api\\Http\\Request))",
      "#40 /Users/dorelljames/testproject/vendor/dingo/api/src/Http/Middleware/Request.php(127): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))",
      "#41 /Users/dorelljames/testproject/vendor/dingo/api/src/Http/Middleware/Request.php(103): Dingo\\Api\\Http\\Middleware\\Request->sendRequestThroughRouter(Object(Dingo\\Api\\Http\\Request))",
      "#42 [internal function]: Dingo\\Api\\Http\\Middleware\\Request->handle(Object(Dingo\\Api\\Http\\Request), Object(Closure))",
      "#43 /Users/dorelljames/testproject/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(124): call_user_func_array(Array, Array)",
      "#44 [internal function]: Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))",
      "#45 /Users/dorelljames/testproject/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): call_user_func(Object(Closure), Object(Illuminate\\Http\\Request))",
      "#46 /Users/dorelljames/testproject/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(122): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))",
      "#47 /Users/dorelljames/testproject/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(87): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter(Object(Illuminate\\Http\\Request))",
      "#48 /Users/dorelljames/testproject/public/index.php(53): Illuminate\\Foundation\\Http\\Kernel->handle(Object(Illuminate\\Http\\Request))",
      "#49 /Users/dorelljames/.composer/vendor/laravel/valet/server.php(106): require('/Users/dorellja...')",
      "#50 {main}"
    ]
  }
}

Expose swagger over SSL

I am getting this error when I push my project to a SSL server:

Mixed Content: The page at 'https://mydomain.com/api/documentation#!/Auth_Endpoints/post_api_auth_token'
was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 
'http://mydomain.com/docs/api-docs.json'. This request has been blocked; 
the content must be served over HTTPS.

Swagger config:

/**
 * @SWG\Swagger(
 *     schemes={"https"},
 *     @SWG\Info(
 *         version="1.0.0",
 *         title="API title",
 *         description="API description",
 *         @SWG\Contact(
 *             email="[email protected]"
 *         )
 *     )
 * )
 */

In my .env file, I have set this: APP_URL=https://server.261itsolutions.com. But no luck, maybe I am missing something important

Is Lumen 5.2 supported?

Hi,
Is this package supposed to work with Lumen - specially 5.2?

After install the package and register the service provider, I got this error when running php artisan:

PHP Fatal error:  Call to undefined function Darkaonline\L5Swagger\config_path()
in /vendor/darkaonline/l5-swagger/src/L5SwaggerServiceProvider.php on line 34

I don't built APIs in Laravel, only in Lumen, as APIs usually don't need most of Laravel specific stuff - I guess that's what Lumen was built for.

Any advice on how to get it working with Lumen?
If this package doesn't aim to support Lumen that's fine. I would appreciate if you could point me to any other package that integrates Swagger with Lumen.

Thanks!

Sagger ui asset exceptions

v5 l5-swagger seems to be throwing off a few asset based exceptions, it's not entirely clear if this is a configuration issue (?) as they don't appear to be explicitly allowed in src/helpers.php

(swagger-ui-bundle.js.map) - this L5 Swagger asset is not allowed
(swagger-ui.css.map) - this L5 Swagger asset is not allowed
(swagger-ui-standalone-preset.js.map) - this L5 Swagger asset is not allowed

Support middlware for routes

Currently I don't want to public the api/document so I want to add a middleware to that API.
I can redefine another route and add middleware, but it will be great if L5-Swagger supports it naturally.
Do you have any plan on this one, or may be I can help you add this feature.

This is what I think it will be:

  • Add one more configuration value call "middleware"
  • In routes file, we will add middleware from configuration file.

How do you think ?

Thanks and sorry for any typos.

Routes not taken into account

Hi,

Thanks for your work, I was looking for a way to use easily swagger-php with Laravel 5.

Unfortunately, it seems like the "routes.php" file is not taken into account : the routes don't work unless I copy/paste the file's content directly in the main routes file : app/Http/routes.php

I can see in the service provider that the file is included in the register function but the app won't respond to the specified request : /api-docs and /docs

Any explanation for this ? Thanks !

How to specify authentication?

How I can specify authentication form API endpoint?
Here is what I am trying to do:

    /**
     * @SWG\Get(
     *     path="/api/course-types",
     *     summary="List of available course types",
     *     @SWG\Response(response="200", description="List of available course types"),
     *     @SWG\Response(response="default", description="an unexpected error"),
     *     security={
     *         {
     *             "type": "apiKey",
     *             "in": "header",
     *             "name": "MY-API-KEY"
     *         }
     *     }
     * )
     */

'query' is hard coded

Hi again.

same as last issue which was changing "api_key" to variable in config file, it would be nice to let it be configurable where it should inject in query or in header.

in file resources/views/index.blade.php at line 72,

window.authorizations.add('{{$apiKeyVar}}', new ApiKeyAuthorization('{{$apiKeyVar}}', key, "query"));

my api accept access token just in header not in query.

thanks a lot.

middleware doesn't work

In your routes.php you have :
config('l5-swagger.middleware.api', [])

But it is :
config('l5-swagger.routes.middleware.api', [])

PR here : #54

l5-swagger vendor:publish Exception

I am trying to publish config for l5-swagger but getting the error below, can anyone help with this?

[Symfony\Component\Debug\Exception\FatalThrowableError]
Wrong parameters for L5Swagger\Exceptions\L5SwaggerException([string $message [, long $code [, Thr
owable $previous = NULL]]])

I also tried php artisan l5-swagger:publish

Route error then No hint path defined for [l5-swagger] error

I have a number of new L5 packages so the others work fine. I followed you instructions as well.

Routes

Finally I copied your route info into mine and obviously routes worked.

But I do see your routes.php included in the provider but when I went to /api-docs I got the standard not found error

https://www.dropbox.com/s/urs48l0xvpsqk47/Screenshot%202015-03-20%2006.40.28.png?dl=0

So I copied your routes into mine which led to the next error

No hint path defined for [l5-swagger].

https://www.dropbox.com/s/hw4afo35kp1evhh/Screenshot%202015-03-20%2006.37.49.png?dl=0

This one I had to add this line to my routes.php

Route::get('api-docs', function() {
    View::addNamespace('l5-swagger', base_path('/resources/views/vendor/l5-swagger'));
    if (Config::get('l5-swagger.generateAlways')) {
        \Darkaonline\L5Swagger\Generator::generateDocs();
    }

Now the page loads though I still need to explore how it is working

https://www.dropbox.com/s/e18obt2jcswgwf6/Screenshot%202015-03-20%2006.42.02.png?dl=0

Thanks for your work on this btw!

Security definition and the header name have to be the same.

Currently, when you open up the Swagger UI, the apiKey that gets added has to have the same securityDefinition name and header name for it to work. This is due to this line https://github.com/DarkaOnLine/L5-Swagger/blob/master/resources/views/index.blade.php#L72.

window.authorizations.add('{{$apiKeyVar}}', new ApiKeyAuthorization('{{$apiKeyVar}}', key, "{{$apiKeyInject}}"));

The first place where {{$apiKeyVar}} is used, this place should hold the securityDefinition name (key of the securityDefinition in the swagger.json file), and the first argument of the ApiKeyAuthorization constructor should be the header that the key is sent in. The only way to insure it is to change the securityDefinition name to be the name of the header you are sending your key with.

This is confusing and should be fixed with an additional config parameter or at least documented. I will submit a pull request if you feel this should be fixed.

I don't use yaml in Laravel 5.1

I use the YAML .Happen "Can't read from server. It may not have the appropriate access-control-origin settings."

image

I would like to ask how the changes?

RequiredSWG@Info not found

i try run
php artisan l5-swagger:generate

then got error

[ErrorException]
Required @SWG\Info() not found

Include additional directories to scan

I have been separating my API into a separate service provider (module), however your app only scans the base path.

        $swagger = \Swagger\scan($appDir, ['exclude' => $excludeDirs]);

Would be great to add custom paths in the config file too.

Bad headers for assets

Resource interpreted as Stylesheet but transferred with MIME type text/html: "/docs/asset/swagger-ui.css".

So with laravel-debugbar, the debugbar script is included in this css file and break the stylesheet.

Update version of Swagger UI

Would it be possible to update the version of Swagger UI being used by L5-Swagger?

I have an issue with tag sorting (see swagger-api/swagger-ui#1475) which was addressed in Swagger UI 2.1.5 (I think). It seems the version being used by L5-Swagger is 2.1.4.

Swagger UI 2.2.1 seems to be a fairly major release, so I'm not sure how that affects your code. Not much is mentioned on the release page for 2.1.5 and 2.2.0 (https://github.com/swagger-api/swagger-ui/releases) so I assume they are fairly minor bug fix releases. I think either of those slightly newer version would fix my issue.

ability to set an apiKey

Hi,
In the previous version (v4) we have the ability to put a JWT token with :
config(['l5-swagger.api.auth_token' => 'bearer'.$jwtToken]);

I can't find the way to do that in v5 :(

How to escape the " (double quotes) character on Parameter Description

Hi all,
I have a question about writing description on swagger-php.
For example I have the following parameter description:

* ...
* @SWG\Parameter(
*          name="products",
*          in="formData",
*          type="string",
*          description="set of json from products eg:<br>'{ '0' : { 'id' : '1', 'sku' : 'SKU00614803', 'name' : 'Oncom Gondrong', 'image' : 'oncom.jpg', 'price' : '100000' }, '1' : { 'id' : '2', 'sku' : 'SKU00614804', 'name' : 'Tempe Bacem', 'image' : 'tempe.jpg', 'price' : '150000' }}'",
*          required=true
*      ),
* ...

I want to write the JSON sample to one of the parameter. Actually if I wrote the sample like above, the swagger can be generated successfully, but that is the wrong JSON format. JSON should be use " (double quotes) character instead of ' (single quote).
But if I replace all the ' to ", I cannot generate the swagger. I says an error:

[Syntax Error] Expected Doctrine\Common\Annotations\DocLexer::T_CLOSE_PARENTHESIS, got 'id' in...

Anybody know how to solve my problem,.?

thanks

Installation fails for Laravel 5.4

Following command fails:
composer require "darkaonline/l5-swagger:~3.0"

with error:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - darkaonline/l5-swagger 3.2.1 requires laravel/framework 5.1.*|5.2.*|5.3.* -> satisfiable by laravel/framework[5.1.x-dev, 5.2.41, 5.2.x-dev, 5.3.x-dev, v5.1.0, v5.1.1, v5.1.10, v5.1.11, v5.1.1                                                                          2, v5.1.13, v5.1.14, v5.1.15, v5.1.16, v5.1.17, v5.1.18, v5.1.19, v5.1.2, v5.1.20, v5.1.21, v5.1.22, v5.1.23, v5.1.24, v5.1.25, v5.1.26, v5.1.27, v5.1.28, v5.1.29, v5.1.3, v5.1.30, v5.1.31, v5.1.32                                                                          , v5.1.33, v5.1.34, v5.1.35, v5.1.36, v5.1.37, v5.1.38, v5.1.39, v5.1.4, v5.1.40, v5.1.41, v5.1.42, v5.1.43, v5.1.44, v5.1.45, v5.1.5, v5.1.6, v5.1.7, v5.1.8, v5.1.9, v5.2.0, v5.2.0-beta1, v5.2.1,                                                                           v5.2.10, v5.2.11, v5.2.12, v5.2.13, v5.2.14, v5.2.15, v5.2.16, v5.2.17, v5.2.18, v5.2.19, v5.2.2, v5.2.20, v5.2.21, v5.2.22, v5.2.23, v5.2.24, v5.2.25, v5.2.26, v5.2.27, v5.2.28, v5.2.29, v5.2.3, v                                                                          5.2.30, v5.2.31, v5.2.32, v5.2.33, v5.2.34, v5.2.35, v5.2.36, v5.2.37, v5.2.38, v5.2.39, v5.2.4, v5.2.40, v5.2.42, v5.2.43, v5.2.44, v5.2.45, v5.2.5, v5.2.6, v5.2.7, v5.2.8, v5.2.9, v5.3.0, v5.3.0-                                                                          RC1, v5.3.1, v5.3.10, v5.3.11, v5.3.12, v5.3.13, v5.3.14, v5.3.15, v5.3.16, v5.3.17, v5.3.18, v5.3.19, v5.3.2, v5.3.20, v5.3.21, v5.3.22, v5.3.23, v5.3.24, v5.3.25, v5.3.26, v5.3.27, v5.3.28, v5.3.                                                                          29, v5.3.3, v5.3.30, v5.3.4, v5.3.5, v5.3.6, v5.3.7, v5.3.8, v5.3.9] but these conflict with your requirements or minimum-stability.
    - darkaonline/l5-swagger 3.2 requires laravel/framework 5.1.*|5.2.*|5.3.* -> satisfiable by laravel/framework[5.1.x-dev, 5.2.41, 5.2.x-dev, 5.3.x-dev, v5.1.0, v5.1.1, v5.1.10, v5.1.11, v5.1.12,                                                                           v5.1.13, v5.1.14, v5.1.15, v5.1.16, v5.1.17, v5.1.18, v5.1.19, v5.1.2, v5.1.20, v5.1.21, v5.1.22, v5.1.23, v5.1.24, v5.1.25, v5.1.26, v5.1.27, v5.1.28, v5.1.29, v5.1.3, v5.1.30, v5.1.31, v5.1.32,                                                                           v5.1.33, v5.1.34, v5.1.35, v5.1.36, v5.1.37, v5.1.38, v5.1.39, v5.1.4, v5.1.40, v5.1.41, v5.1.42, v5.1.43, v5.1.44, v5.1.45, v5.1.5, v5.1.6, v5.1.7, v5.1.8, v5.1.9, v5.2.0, v5.2.0-beta1, v5.2.1, v5                                                                          .2.10, v5.2.11, v5.2.12, v5.2.13, v5.2.14, v5.2.15, v5.2.16, v5.2.17, v5.2.18, v5.2.19, v5.2.2, v5.2.20, v5.2.21, v5.2.22, v5.2.23, v5.2.24, v5.2.25, v5.2.26, v5.2.27, v5.2.28, v5.2.29, v5.2.3, v5.                                                                          2.30, v5.2.31, v5.2.32, v5.2.33, v5.2.34, v5.2.35, v5.2.36, v5.2.37, v5.2.38, v5.2.39, v5.2.4, v5.2.40, v5.2.42, v5.2.43, v5.2.44, v5.2.45, v5.2.5, v5.2.6, v5.2.7, v5.2.8, v5.2.9, v5.3.0, v5.3.0-RC                                                                          1, v5.3.1, v5.3.10, v5.3.11, v5.3.12, v5.3.13, v5.3.14, v5.3.15, v5.3.16, v5.3.17, v5.3.18, v5.3.19, v5.3.2, v5.3.20, v5.3.21, v5.3.22, v5.3.23, v5.3.24, v5.3.25, v5.3.26, v5.3.27, v5.3.28, v5.3.29                                                                          , v5.3.3, v5.3.30, v5.3.4, v5.3.5, v5.3.6, v5.3.7, v5.3.8, v5.3.9] but these conflict with your requirements or minimum-stability.
    - darkaonline/l5-swagger 3.1.5 requires laravel/framework 5.1.*|5.2.*|5.3.* -> satisfiable by laravel/framework[5.1.x-dev, 5.2.41, 5.2.x-dev, 5.3.x-dev, v5.1.0, v5.1.1, v5.1.10, v5.1.11, v5.1.1                                                                          2, v5.1.13, v5.1.14, v5.1.15, v5.1.16, v5.1.17, v5.1.18, v5.1.19, v5.1.2, v5.1.20, v5.1.21, v5.1.22, v5.1.23, v5.1.24, v5.1.25, v5.1.26, v5.1.27, v5.1.28, v5.1.29, v5.1.3, v5.1.30, v5.1.31, v5.1.32                                                                          , v5.1.33, v5.1.34, v5.1.35, v5.1.36, v5.1.37, v5.1.38, v5.1.39, v5.1.4, v5.1.40, v5.1.41, v5.1.42, v5.1.43, v5.1.44, v5.1.45, v5.1.5, v5.1.6, v5.1.7, v5.1.8, v5.1.9, v5.2.0, v5.2.0-beta1, v5.2.1,                                                                           v5.2.10, v5.2.11, v5.2.12, v5.2.13, v5.2.14, v5.2.15, v5.2.16, v5.2.17, v5.2.18, v5.2.19, v5.2.2, v5.2.20, v5.2.21, v5.2.22, v5.2.23, v5.2.24, v5.2.25, v5.2.26, v5.2.27, v5.2.28, v5.2.29, v5.2.3, v                                                                          5.2.30, v5.2.31, v5.2.32, v5.2.33, v5.2.34, v5.2.35, v5.2.36, v5.2.37, v5.2.38, v5.2.39, v5.2.4, v5.2.40, v5.2.42, v5.2.43, v5.2.44, v5.2.45, v5.2.5, v5.2.6, v5.2.7, v5.2.8, v5.2.9, v5.3.0, v5.3.0-                                                                          RC1, v5.3.1, v5.3.10, v5.3.11, v5.3.12, v5.3.13, v5.3.14, v5.3.15, v5.3.16, v5.3.17, v5.3.18, v5.3.19, v5.3.2, v5.3.20, v5.3.21, v5.3.22, v5.3.23, v5.3.24, v5.3.25, v5.3.26, v5.3.27, v5.3.28, v5.3.                                                                          29, v5.3.3, v5.3.30, v5.3.4, v5.3.5, v5.3.6, v5.3.7, v5.3.8, v5.3.9] but these conflict with your requirements or minimum-stability.
    - darkaonline/l5-swagger 3.1.4 requires laravel/framework 5.1.*|5.2.* -> satisfiable by laravel/framework[5.1.x-dev, 5.2.41, 5.2.x-dev, v5.1.0, v5.1.1, v5.1.10, v5.1.11, v5.1.12, v5.1.13, v5.1.                                                                          14, v5.1.15, v5.1.16, v5.1.17, v5.1.18, v5.1.19, v5.1.2, v5.1.20, v5.1.21, v5.1.22, v5.1.23, v5.1.24, v5.1.25, v5.1.26, v5.1.27, v5.1.28, v5.1.29, v5.1.3, v5.1.30, v5.1.31, v5.1.32, v5.1.33, v5.1.3                                                                          4, v5.1.35, v5.1.36, v5.1.37, v5.1.38, v5.1.39, v5.1.4, v5.1.40, v5.1.41, v5.1.42, v5.1.43, v5.1.44, v5.1.45, v5.1.5, v5.1.6, v5.1.7, v5.1.8, v5.1.9, v5.2.0, v5.2.0-beta1, v5.2.1, v5.2.10, v5.2.11,                                                                           v5.2.12, v5.2.13, v5.2.14, v5.2.15, v5.2.16, v5.2.17, v5.2.18, v5.2.19, v5.2.2, v5.2.20, v5.2.21, v5.2.22, v5.2.23, v5.2.24, v5.2.25, v5.2.26, v5.2.27, v5.2.28, v5.2.29, v5.2.3, v5.2.30, v5.2.31,                                                                           v5.2.32, v5.2.33, v5.2.34, v5.2.35, v5.2.36, v5.2.37, v5.2.38, v5.2.39, v5.2.4, v5.2.40, v5.2.42, v5.2.43, v5.2.44, v5.2.45, v5.2.5, v5.2.6, v5.2.7, v5.2.8, v5.2.9] but these conflict with your req                                                                          uirements or minimum-stability.
    - darkaonline/l5-swagger 3.1.3 requires laravel/framework 5.1.*|5.2.* -> satisfiable by laravel/framework[5.1.x-dev, 5.2.41, 5.2.x-dev, v5.1.0, v5.1.1, v5.1.10, v5.1.11, v5.1.12, v5.1.13, v5.1.                                                                          14, v5.1.15, v5.1.16, v5.1.17, v5.1.18, v5.1.19, v5.1.2, v5.1.20, v5.1.21, v5.1.22, v5.1.23, v5.1.24, v5.1.25, v5.1.26, v5.1.27, v5.1.28, v5.1.29, v5.1.3, v5.1.30, v5.1.31, v5.1.32, v5.1.33, v5.1.3                                                                          4, v5.1.35, v5.1.36, v5.1.37, v5.1.38, v5.1.39, v5.1.4, v5.1.40, v5.1.41, v5.1.42, v5.1.43, v5.1.44, v5.1.45, v5.1.5, v5.1.6, v5.1.7, v5.1.8, v5.1.9, v5.2.0, v5.2.0-beta1, v5.2.1, v5.2.10, v5.2.11,                                                                           v5.2.12, v5.2.13, v5.2.14, v5.2.15, v5.2.16, v5.2.17, v5.2.18, v5.2.19, v5.2.2, v5.2.20, v5.2.21, v5.2.22, v5.2.23, v5.2.24, v5.2.25, v5.2.26, v5.2.27, v5.2.28, v5.2.29, v5.2.3, v5.2.30, v5.2.31,                                                                           v5.2.32, v5.2.33, v5.2.34, v5.2.35, v5.2.36, v5.2.37, v5.2.38, v5.2.39, v5.2.4, v5.2.40, v5.2.42, v5.2.43, v5.2.44, v5.2.45, v5.2.5, v5.2.6, v5.2.7, v5.2.8, v5.2.9] but these conflict with your req                                                                          uirements or minimum-stability.
    - darkaonline/l5-swagger 3.1.2 requires laravel/framework 5.1.*|5.2.* -> satisfiable by laravel/framework[5.1.x-dev, 5.2.41, 5.2.x-dev, v5.1.0, v5.1.1, v5.1.10, v5.1.11, v5.1.12, v5.1.13, v5.1.                                                                          14, v5.1.15, v5.1.16, v5.1.17, v5.1.18, v5.1.19, v5.1.2, v5.1.20, v5.1.21, v5.1.22, v5.1.23, v5.1.24, v5.1.25, v5.1.26, v5.1.27, v5.1.28, v5.1.29, v5.1.3, v5.1.30, v5.1.31, v5.1.32, v5.1.33, v5.1.3                                                                          4, v5.1.35, v5.1.36, v5.1.37, v5.1.38, v5.1.39, v5.1.4, v5.1.40, v5.1.41, v5.1.42, v5.1.43, v5.1.44, v5.1.45, v5.1.5, v5.1.6, v5.1.7, v5.1.8, v5.1.9, v5.2.0, v5.2.0-beta1, v5.2.1, v5.2.10, v5.2.11,                                                                           v5.2.12, v5.2.13, v5.2.14, v5.2.15, v5.2.16, v5.2.17, v5.2.18, v5.2.19, v5.2.2, v5.2.20, v5.2.21, v5.2.22, v5.2.23, v5.2.24, v5.2.25, v5.2.26, v5.2.27, v5.2.28, v5.2.29, v5.2.3, v5.2.30, v5.2.31,                                                                           v5.2.32, v5.2.33, v5.2.34, v5.2.35, v5.2.36, v5.2.37, v5.2.38, v5.2.39, v5.2.4, v5.2.40, v5.2.42, v5.2.43, v5.2.44, v5.2.45, v5.2.5, v5.2.6, v5.2.7, v5.2.8, v5.2.9] but these conflict with your req                                                                          uirements or minimum-stability.
    - darkaonline/l5-swagger 3.1.1 requires laravel/framework 5.2.* -> satisfiable by laravel/framework[5.2.41, 5.2.x-dev, v5.2.0, v5.2.0-beta1, v5.2.1, v5.2.10, v5.2.11, v5.2.12, v5.2.13, v5.2.14,                                                                           v5.2.15, v5.2.16, v5.2.17, v5.2.18, v5.2.19, v5.2.2, v5.2.20, v5.2.21, v5.2.22, v5.2.23, v5.2.24, v5.2.25, v5.2.26, v5.2.27, v5.2.28, v5.2.29, v5.2.3, v5.2.30, v5.2.31, v5.2.32, v5.2.33, v5.2.34,                                                                           v5.2.35, v5.2.36, v5.2.37, v5.2.38, v5.2.39, v5.2.4, v5.2.40, v5.2.42, v5.2.43, v5.2.44, v5.2.45, v5.2.5, v5.2.6, v5.2.7, v5.2.8, v5.2.9] but these conflict with your requirements or minimum-stabil                                                                          ity.
    - darkaonline/l5-swagger 3.1 requires laravel/framework 5.2.* -> satisfiable by laravel/framework[5.2.41, 5.2.x-dev, v5.2.0, v5.2.0-beta1, v5.2.1, v5.2.10, v5.2.11, v5.2.12, v5.2.13, v5.2.14, v                                                                          5.2.15, v5.2.16, v5.2.17, v5.2.18, v5.2.19, v5.2.2, v5.2.20, v5.2.21, v5.2.22, v5.2.23, v5.2.24, v5.2.25, v5.2.26, v5.2.27, v5.2.28, v5.2.29, v5.2.3, v5.2.30, v5.2.31, v5.2.32, v5.2.33, v5.2.34, v5                                                                          .2.35, v5.2.36, v5.2.37, v5.2.38, v5.2.39, v5.2.4, v5.2.40, v5.2.42, v5.2.43, v5.2.44, v5.2.45, v5.2.5, v5.2.6, v5.2.7, v5.2.8, v5.2.9] but these conflict with your requirements or minimum-stabilit                                                                          y.
    - darkaonline/l5-swagger 3.0.1 requires laravel/framework 5.2.* -> satisfiable by laravel/framework[5.2.41, 5.2.x-dev, v5.2.0, v5.2.0-beta1, v5.2.1, v5.2.10, v5.2.11, v5.2.12, v5.2.13, v5.2.14,                                                                           v5.2.15, v5.2.16, v5.2.17, v5.2.18, v5.2.19, v5.2.2, v5.2.20, v5.2.21, v5.2.22, v5.2.23, v5.2.24, v5.2.25, v5.2.26, v5.2.27, v5.2.28, v5.2.29, v5.2.3, v5.2.30, v5.2.31, v5.2.32, v5.2.33, v5.2.34,                                                                           v5.2.35, v5.2.36, v5.2.37, v5.2.38, v5.2.39, v5.2.4, v5.2.40, v5.2.42, v5.2.43, v5.2.44, v5.2.45, v5.2.5, v5.2.6, v5.2.7, v5.2.8, v5.2.9] but these conflict with your requirements or minimum-stabil                                                                          ity.
    - darkaonline/l5-swagger 3.0 requires laravel/framework 5.2.* -> satisfiable by laravel/framework[5.2.41, 5.2.x-dev, v5.2.0, v5.2.0-beta1, v5.2.1, v5.2.10, v5.2.11, v5.2.12, v5.2.13, v5.2.14, v                                                                          5.2.15, v5.2.16, v5.2.17, v5.2.18, v5.2.19, v5.2.2, v5.2.20, v5.2.21, v5.2.22, v5.2.23, v5.2.24, v5.2.25, v5.2.26, v5.2.27, v5.2.28, v5.2.29, v5.2.3, v5.2.30, v5.2.31, v5.2.32, v5.2.33, v5.2.34, v5                                                                          .2.35, v5.2.36, v5.2.37, v5.2.38, v5.2.39, v5.2.4, v5.2.40, v5.2.42, v5.2.43, v5.2.44, v5.2.45, v5.2.5, v5.2.6, v5.2.7, v5.2.8, v5.2.9] but these conflict with your requirements or minimum-stabilit                                                                          y.
    - Installation request for darkaonline/l5-swagger ~3.0 -> satisfiable by darkaonline/l5-swagger[3.0, 3.0.1, 3.1, 3.1.1, 3.1.2, 3.1.3, 3.1.4, 3.1.5, 3.2, 3.2.1].


Installation failed, reverting ./composer.json to its original content.

My environment info:
Windows 7
php 7.1
Laravel 5.4

Examples tag

I can't seem to get examples tag working, or maybe I'm doing something wrong.

/**

  • @swg\Response(
  •  response=200,
    
  •  description="Success",
    
  •  examples={"application/json": {"id": "1"}}
    

*/

config settings explanation

I don't understand the default config file due to a lack of documentation:

  1. What are annotations and why is the base_path set to app?
  2. What is base and why is it empty by default?
  3. How do you change the name of the documentation file? It's called api-docs.json, but I need to create routes for different versions and the version number should be in the file name. I see the docs key, but the comment doesn't make much sense. What is a parsed swagger annotation and how is that different than a generated annotation and/or a manually generated file?

Class resource does not exist

Hi,

I have installed as per the documentation with example annotations and it appears to work OK.

However, if I manually call: php artisan l5-swagger:generate

I get:

[ErrorException]               
Class resource does not exist  

Apart from this error, the documentation seems to get generated and works OK but I am unsure what is causing and if it will cause problems down the line.

I'm running Laravel 5.2.45 and installed package "darkaonline/l5-swagger": "~3.0"

Any ideas?

Thanks!

php artisan l5-swagger:generate

Hi I run all comands from readme, but I have problem with last one:

when I use php artisan l5-swagger:generate I see error:

[ErrorException] Required @SWG\Info() not found

After 4 commands my folder structure looks like:

This

In console.log on page: o2c.html I see:
Uncaught TypeError: Cannot read property 'swaggerUi' of null o2c.html:14

P.S You have also typo in readme should be /vendor not /vendos

HTML/CSS don't look right

I'm using L5.2 and L5-Swagger 3.0. I followed the instructions in the readme and the documentation loads, but it doesn't look right. I've used swagger in a rails project and I had similar issues, but I don't know how to solve the problem in Laravel.

Here's how it looks currently:
capture

I generated a JSON file manually with a few endpoints and, as you can see, it loads with the right values in the right places, but the formatting is messed up. What would be causing this?

Required @SWG\Info() not found

when i set L5_SWAGGER_GENERATE_ALWAYS=true in .env file i am getting error

Required @swg\Info() not found

it looks like i have to give this comment, but not sure where i have to give it

"api_key" is hard coded

Hi
in file resources/views/index.blade.php at line 74,
window.authorizations.add("api_key", new ApiKeyAuthorization("api_key", key, "query"));
"api_key" is hard coded.
I wish it was variable that could be set in config.
my api uses "access_token" instead.

thanks a lot man.

Laravel 5.4 support

Since there are no ground-breaking changes in Laravel 5.4, I see no direct reason why L5-Swagger wouldn't support L5.4. Could you change Composer.json so it also requires L5.4?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.