Skip to content

Commit

Permalink
chore: correct logic for detecting invalid documentation_viewer confi…
Browse files Browse the repository at this point in the history
…guration.
  • Loading branch information
Konstantin Lapkovsky committed Nov 6, 2023
1 parent ff0d072 commit 6471368
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/Services/SwaggerService.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,6 @@ class SwaggerService
'int' => 'integer'
];

protected $documentationViewers = [
'swagger',
'elements',
'rapidoc'
];

public function __construct(Container $container)
{
$this->openAPIValidator = app(SwaggerSpecValidator::class);
Expand Down Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 6471368

Please sign in to comment.