From 6471368c89fcd4ab1fe9ad4a05f19285410b2094 Mon Sep 17 00:00:00 2001 From: Konstantin Lapkovsky Date: Mon, 6 Nov 2023 11:57:15 +0400 Subject: [PATCH] chore: correct logic for detecting invalid documentation_viewer configuration. --- src/Services/SwaggerService.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/Services/SwaggerService.php b/src/Services/SwaggerService.php index 45ee913..7652281 100755 --- a/src/Services/SwaggerService.php +++ b/src/Services/SwaggerService.php @@ -57,12 +57,6 @@ class SwaggerService 'int' => 'integer' ]; - protected $documentationViewers = [ - 'swagger', - 'elements', - 'rapidoc' - ]; - public function __construct(Container $container) { $this->openAPIValidator = app(SwaggerSpecValidator::class); @@ -103,7 +97,8 @@ protected function initConfig() } $documentationViewer = (string)Arr::get($this->config, 'documentation_viewer'); - if (!in_array($documentationViewer, $this->documentationViewers)) { + + if (!view()->exists("auto-doc::documentation-{$documentationViewer}")) { throw new UnsupportedDocumentationViewerException($documentationViewer); } }