Skip to content

Commit f269b45

Browse files
committed
feat: Swagger Open API support for new version
1 parent c9915b3 commit f269b45

File tree

5 files changed

+6
-17
lines changed

5 files changed

+6
-17
lines changed

config/laravel_generator.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,6 @@
117117

118118
'api_prefix' => 'api',
119119

120-
'api_version' => 'v1',
121-
122120
/*
123121
|--------------------------------------------------------------------------
124122
| Options

src/Commands/Publish/GeneratorPublishCommand.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,8 @@ public function handle()
4949
*/
5050
private function fillTemplate($templateData)
5151
{
52-
$apiVersion = config('infyom.laravel_generator.api_version', 'v1');
5352
$apiPrefix = config('infyom.laravel_generator.api_prefix', 'api');
5453

55-
$templateData = str_replace('$API_VERSION$', $apiVersion, $templateData);
5654
$templateData = str_replace('$API_PREFIX$', $apiPrefix, $templateData);
5755
$appNamespace = $this->getLaravel()->getNamespace();
5856
$appNamespace = substr($appNamespace, 0, strlen($appNamespace) - 1);

src/Common/GeneratorConfig.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -334,11 +334,6 @@ public function loadDynamicVariables(CommandData &$commandData)
334334
config('infyom.laravel_generator.api_prefix', 'api')
335335
);
336336

337-
$commandData->addDynamicVariable(
338-
'$API_VERSION$',
339-
config('infyom.laravel_generator.api_version', 'v1')
340-
);
341-
342337
$commandData->addDynamicVariable('$SEARCHABLE$', '');
343338

344339
return $commandData;

src/Generators/Scaffold/RequestGenerator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ private function generateUpdateRequest()
6666
public function rollback()
6767
{
6868
if ($this->rollbackFile($this->path, $this->createFileName)) {
69-
$this->commandData->commandComment('Create API Request file deleted: '.$this->createFileName);
69+
$this->commandData->commandComment('Create Request file deleted: '.$this->createFileName);
7070
}
7171

7272
if ($this->rollbackFile($this->path, $this->updateFileName)) {
73-
$this->commandData->commandComment('Update API Request file deleted: '.$this->updateFileName);
73+
$this->commandData->commandComment('Update Request file deleted: '.$this->updateFileName);
7474
}
7575
}
7676
}

templates/app_base_controller.stub

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,10 @@ use InfyOm\Generator\Utils\ResponseUtil;
66
use Response;
77

88
/**
9-
* @SWG\Swagger(
10-
* basePath="/$API_PREFIX$/$API_VERSION$",
11-
* @SWG\Info(
12-
* title="Laravel Generator APIs",
13-
* version="1.0.0",
14-
* )
9+
* @OA\Server(url="/$API_PREFIX$")
10+
* @OA\Info(
11+
* title="InfyOm Laravel Generator APIs",
12+
* version="1.0.0"
1513
* )
1614
* This class should be parent class for other API controllers
1715
* Class AppBaseController

0 commit comments

Comments
 (0)