Skip to content

Commit

Permalink
Update RenderApidocJsonTask.php (#5)
Browse files Browse the repository at this point in the history
Add config('apiato.api.prefix') in url and sampleUrl
  • Loading branch information
polarikus authored Oct 14, 2022
1 parent 709d9f0 commit 272cf3b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Tasks/RenderApidocJsonTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,17 @@ class RenderApidocJsonTask extends Task

public function __construct(string $docType)
{
//remove last '/' in api prefix
$apiPrefix = substr(config('apiato.api.prefix'), 0,-1);

$this->templatePath = 'Containers/' . config('vendor-documentation.section_name') . '/Documentation/ApiDocJs/' . $docType . '/apidoc.json';
$this->outputPath = 'Containers/' . config('vendor-documentation.section_name') . '/Documentation/ApiDocJs/' . $docType . '/apidoc.json';
$this->replaceArray = [
'name' => config('app.name'),
'description' => config('app.name') . ' (' . ucfirst($docType) . ' API) Documentation',
'title' => 'Welcome to ' . config('app.name'),
'url' => config('apiato.api.url'),
'sampleUrl' => config('vendor-documentation.enable-sending-sample-request') ? config('apiato.api.url') : null,
'url' => config('apiato.api.url').$apiPrefix,
'sampleUrl' => config('vendor-documentation.enable-sending-sample-request') ? config('apiato.api.url').$apiPrefix : null,
];
}

Expand Down

0 comments on commit 272cf3b

Please sign in to comment.