Skip to content

Commit

Permalink
Use local OpenApi spec default version constant
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkaOnLine committed Sep 22, 2022
1 parent 958e477 commit 90d4bd9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion config/l5-swagger.php
Expand Up @@ -145,7 +145,7 @@
* Allows to generate specs either for OpenAPI 3.0.0 or OpenAPI 3.1.0.
* By default the spec will be in version 3.0.0
*/
'open_api_spec_version' => env('L5_SWAGGER_OPEN_API_SPEC_VERSION', \OpenApi\Annotations\OpenApi::DEFAULT_VERSION),
'open_api_spec_version' => env('L5_SWAGGER_OPEN_API_SPEC_VERSION', \L5Swagger\Generator::OPEN_API_DEFAULT_SPEC_VERSION),
],

/*
Expand Down
4 changes: 3 additions & 1 deletion src/Generator.php
Expand Up @@ -16,6 +16,8 @@

class Generator
{
public const OPEN_API_DEFAULT_SPEC_VERSION = '3.0.0';

protected const SCAN_OPTION_PROCESSORS = 'processors';
protected const SCAN_OPTION_PATTERN = 'pattern';
protected const SCAN_OPTION_ANALYSER = 'analyser';
Expand Down Expand Up @@ -202,7 +204,7 @@ protected function createOpenApiGenerator(): OpenApiGenerator

// OpenApi spec version.
$generator->setVersion(
$this->scanOptions['open_api_spec_version'] ?? OpenApi::DEFAULT_VERSION
$this->scanOptions['open_api_spec_version'] ?? self::OPEN_API_DEFAULT_SPEC_VERSION
);

// Processors.
Expand Down

0 comments on commit 90d4bd9

Please sign in to comment.