From ec08504e83ce93179d15042799d433da7d12374e Mon Sep 17 00:00:00 2001 From: Darius Matulionis Date: Tue, 5 May 2015 09:30:46 +0300 Subject: [PATCH 1/6] Swagger 2.0 --- src/Generator.php | 30 +++--------------------------- 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/src/Generator.php b/src/Generator.php index 54c53e7..cb95d8c 100644 --- a/src/Generator.php +++ b/src/Generator.php @@ -1,6 +1,5 @@ getResourceList(array( - 'output' => 'array', - 'apiVersion' => $defaultApiVersion, - 'swaggerVersion' => $defaultSwaggerVersion, - )); - $resourceOptions = array( - 'output' => 'json', - 'defaultSwaggerVersion' => $resourceList['swaggerVersion'], - 'defaultBasePath' => $defaultBasePath - ); - $output = array(); - foreach ($swagger->getResourceNames() as $resourceName) { - $json = $swagger->getResource($resourceName, $resourceOptions); - $resourceName = str_replace(DIRECTORY_SEPARATOR, '-', ltrim($resourceName, DIRECTORY_SEPARATOR)); - $output[$resourceName] = $json; - } + $swagger = \Swagger\scan($appDir, $excludeDirs); + $filename = $docDir . '/api-docs.json'; - file_put_contents($filename, Swagger::jsonEncode($resourceList, true)); - foreach ($output as $name => $json) { - $name = str_replace(DIRECTORY_SEPARATOR, '-', ltrim($name, DIRECTORY_SEPARATOR)); - $filename = $docDir . '/'.$name . '.json'; - file_put_contents($filename, $json); - } + $swagger->saveAs($filename); } } } \ No newline at end of file From d748ef4d66d3263a19ce27fbf6485009e6452854 Mon Sep 17 00:00:00 2001 From: Darius Matulionis Date: Tue, 5 May 2015 09:36:16 +0300 Subject: [PATCH 2/6] Read me update for separate branches --- README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 706e0b1..01bd452 100644 --- a/README.md +++ b/README.md @@ -3,13 +3,23 @@ L5 Swagger ========== -Swagger for Laravel 5 +Swagger 2.0 for Laravel 5 This package is a copy of [Swaggervel](https://github.com/slampenny/Swaggervel) adapted to work with Laravel 5 with several tweaks. Installation ============ +For Swagger 2.0 +```php + composer require darkaonline/l5-swagger ~2.0 +``` + +For Swagger 1.0 +```php + composer require darkaonline/l5-swagger ~0.1 +``` + - Open your `AppServiceProvider` (located in `app/Providers`) and add this line in `register` function ```php $this->app->register('Darkaonline\L5Swagger\L5SwaggerServiceProvider'); From 50c8f3af983a11a6fe604d6349c63dd432ad3681 Mon Sep 17 00:00:00 2001 From: Darius Matulionis Date: Mon, 11 May 2015 16:06:22 +0300 Subject: [PATCH 3/6] swagger-php version change --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 9c46834..62e4a4e 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ ], "require": { "php": ">=5.4.0", - "zircote/swagger-php": "2.*@dev" + "zircote/swagger-php": "~2.0" }, "autoload": { "psr-4": { From e1070a79bb09aa992227426541e28e1b0ec01d85 Mon Sep 17 00:00:00 2001 From: Josh Strange Date: Mon, 3 Aug 2015 22:02:08 -0400 Subject: [PATCH 4/6] Fixes for 5.1 see https://github.com/laravel/framework/issues/9586 --- src/Console/PublishAssetsCommand.php | 2 +- src/Console/PublishConfigCommand.php | 2 +- src/Console/PublishViewsCommand.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Console/PublishAssetsCommand.php b/src/Console/PublishAssetsCommand.php index 19f80e3..50ca991 100644 --- a/src/Console/PublishAssetsCommand.php +++ b/src/Console/PublishAssetsCommand.php @@ -29,7 +29,7 @@ public function fire() $this->info("Publishing assets files"); $this->call('vendor:publish', array( '--provider' => 'Darkaonline\L5Swagger\L5SwaggerServiceProvider', - '--tag' => 'assets' + '--tag' => ['assets'] )); } diff --git a/src/Console/PublishConfigCommand.php b/src/Console/PublishConfigCommand.php index 07153eb..7913876 100644 --- a/src/Console/PublishConfigCommand.php +++ b/src/Console/PublishConfigCommand.php @@ -29,7 +29,7 @@ public function fire() $this->info("Publish config files"); $this->call('vendor:publish', array( '--provider' => 'Darkaonline\L5Swagger\L5SwaggerServiceProvider', - '--tag' => 'config' + '--tag' => ['config'] )); } diff --git a/src/Console/PublishViewsCommand.php b/src/Console/PublishViewsCommand.php index 4f84882..3e8ee60 100644 --- a/src/Console/PublishViewsCommand.php +++ b/src/Console/PublishViewsCommand.php @@ -29,7 +29,7 @@ public function fire() $this->info("Publishing view files"); $this->call('vendor:publish', array( '--provider' => 'Darkaonline\L5Swagger\L5SwaggerServiceProvider', - '--tag' => 'views' + '--tag' => ['views'] )); } From 525cb216f26a1aa995605f3c81bbf7c38e290954 Mon Sep 17 00:00:00 2001 From: Darius Matulionis Date: Tue, 4 Aug 2015 07:44:35 +0300 Subject: [PATCH 5/6] L5.1 support --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 01bd452..73a837b 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ L5 Swagger ========== -Swagger 2.0 for Laravel 5 +Swagger 2.0 for Laravel 5.1 This package is a copy of [Swaggervel](https://github.com/slampenny/Swaggervel) adapted to work with Laravel 5 with several tweaks. From 3ad14ad4a6d561e5c42edd954c32c7a1e11d706f Mon Sep 17 00:00:00 2001 From: Pezhman Fahimi Date: Mon, 28 Sep 2015 14:33:45 +0330 Subject: [PATCH 6/6] URL::asset --- resources/views/index.blade.php | 37 +++++++++++++++++---------------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/resources/views/index.blade.php b/resources/views/index.blade.php index f89f71e..71409b4 100644 --- a/resources/views/index.blade.php +++ b/resources/views/index.blade.php @@ -7,26 +7,27 @@ Swagger UI - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - +