Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added config to use own generated docs file #583

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions config/l5-swagger.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
'title' => 'L5 Swagger UI',
],

/*
* Use your own generated json documentation file
*/
'use_own_docs' => false,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do have generate_always config param https://github.com/DarkaOnLine/L5-Swagger/blob/master/config/l5-swagger.php#L223 which can be used to disable generation on UI load

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have used the generate_always config to prevent doc generation on the console command on https://github.com/DarkaOnLine/L5-Swagger/pull/584/files. Better we can introduce a new config to control the console commands


'routes' => [
/*
* Route for accessing api documentation interface
Expand Down
6 changes: 6 additions & 0 deletions src/Console/GenerateDocsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ private function generateDocumentation(GeneratorFactory $generatorFactory, strin
{
$this->info('Regenerating docs '.$documentation);

if (config('l5-swagger.documentations.'.$documentation.'.use_own_docs', false)) {
$this->info('Using own docs - skipping doc generation');

return;
}

$generator = $generatorFactory->make($documentation);
$generator->generateDocs();
}
Expand Down
Loading