From 63875ef1f9968c292827a7b59ad877dc9af10b22 Mon Sep 17 00:00:00 2001 From: Henri de Jong Date: Mon, 12 Apr 2021 10:48:28 +0200 Subject: [PATCH 1/4] Add docs_json to urlToDocs for better handling of reference files --- src/Http/Controllers/SwaggerLumeController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Http/Controllers/SwaggerLumeController.php b/src/Http/Controllers/SwaggerLumeController.php index 3f67fdb..6d7eb16 100644 --- a/src/Http/Controllers/SwaggerLumeController.php +++ b/src/Http/Controllers/SwaggerLumeController.php @@ -46,7 +46,7 @@ public function api() $response = new Response( view('swagger-lume::index', [ 'secure' => Request::secure(), - 'urlToDocs' => route('swagger-lume.docs'), + 'urlToDocs' => route('swagger-lume.docs') . '/' . config('swagger-lume.paths.docs_json'), 'operationsSorter' => config('swagger-lume.operations_sort'), 'configUrl' => config('swagger-lume.additional_config_url'), 'validatorUrl' => config('swagger-lume.validator_url'), From 454eb9d3709c5ad20f9d4515e78863657f3490b5 Mon Sep 17 00:00:00 2001 From: Henri de Jong Date: Mon, 12 Apr 2021 11:24:43 +0200 Subject: [PATCH 2/4] Edit route --- src/Http/Controllers/SwaggerLumeController.php | 2 +- src/routes.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Http/Controllers/SwaggerLumeController.php b/src/Http/Controllers/SwaggerLumeController.php index 6d7eb16..d300455 100644 --- a/src/Http/Controllers/SwaggerLumeController.php +++ b/src/Http/Controllers/SwaggerLumeController.php @@ -46,7 +46,7 @@ public function api() $response = new Response( view('swagger-lume::index', [ 'secure' => Request::secure(), - 'urlToDocs' => route('swagger-lume.docs') . '/' . config('swagger-lume.paths.docs_json'), + 'urlToDocs' => route('swagger-lume.docs', ['jsonFile' => config('swagger-lume.paths.docs_json')]), 'operationsSorter' => config('swagger-lume.operations_sort'), 'configUrl' => config('swagger-lume.additional_config_url'), 'validatorUrl' => config('swagger-lume.validator_url'), diff --git a/src/routes.php b/src/routes.php index 81b6898..0f05fde 100644 --- a/src/routes.php +++ b/src/routes.php @@ -1,6 +1,6 @@ get(config('swagger-lume.routes.docs'), [ +$route->get(config('swagger-lume.routes.docs').'/{jsonFile:(?!asset).*}', [ 'as' => 'swagger-lume.docs', 'middleware' => config('swagger-lume.routes.middleware.docs', []), 'uses' => 'Http\Controllers\SwaggerLumeController@docs', From 884f18816a5185860210343d53b4cf7892cb64f8 Mon Sep 17 00:00:00 2001 From: Henri de Jong Date: Mon, 12 Apr 2021 14:54:26 +0200 Subject: [PATCH 3/4] Be backwards compatible --- src/routes.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes.php b/src/routes.php index 0f05fde..2ed81e2 100644 --- a/src/routes.php +++ b/src/routes.php @@ -1,6 +1,6 @@ get(config('swagger-lume.routes.docs').'/{jsonFile:(?!asset).*}', [ +$route->get(config('swagger-lume.routes.docs').'[/{jsonFile:(!asset).*}]', [ 'as' => 'swagger-lume.docs', 'middleware' => config('swagger-lume.routes.middleware.docs', []), 'uses' => 'Http\Controllers\SwaggerLumeController@docs', From f9b53bab0445c83fc5aecc013c579acb63f4bcf8 Mon Sep 17 00:00:00 2001 From: Henri de Jong Date: Mon, 12 Apr 2021 15:07:47 +0200 Subject: [PATCH 4/4] Typo fix --- src/routes.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes.php b/src/routes.php index 2ed81e2..548fb2e 100644 --- a/src/routes.php +++ b/src/routes.php @@ -1,6 +1,6 @@ get(config('swagger-lume.routes.docs').'[/{jsonFile:(!asset).*}]', [ +$route->get(config('swagger-lume.routes.docs').'[/{jsonFile:(?!asset).*}]', [ 'as' => 'swagger-lume.docs', 'middleware' => config('swagger-lume.routes.middleware.docs', []), 'uses' => 'Http\Controllers\SwaggerLumeController@docs',