Skip to content

Commit

Permalink
fixed parameters extractors for different api versions
Browse files Browse the repository at this point in the history
  • Loading branch information
romalytvynenko committed Feb 12, 2025
1 parent 82e5e4a commit 7ce4425
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 8 additions & 0 deletions src/Configuration/ParametersExtractors.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

namespace Dedoc\Scramble\Configuration;

use Dedoc\Scramble\Support\OperationExtensions\ParameterExtractor\AttributesParametersExtractor;
use Dedoc\Scramble\Support\OperationExtensions\ParameterExtractor\FormRequestParametersExtractor;
use Dedoc\Scramble\Support\OperationExtensions\ParameterExtractor\MethodCallsParametersExtractor;
use Dedoc\Scramble\Support\OperationExtensions\ParameterExtractor\PathParametersExtractor;
use Dedoc\Scramble\Support\OperationExtensions\ParameterExtractor\ValidateCallParametersExtractor;
use Illuminate\Support\Arr;
Expand Down Expand Up @@ -50,10 +52,16 @@ public function all(): array
ValidateCallParametersExtractor::class,
];

$defaultAppends = [
MethodCallsParametersExtractor::class,
AttributesParametersExtractor::class,
];

return array_values(array_unique([
...$this->prepends,
...$base,
...$this->appends,
...$defaultAppends,
]));
}
}
10 changes: 1 addition & 9 deletions src/ScrambleServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,15 +206,7 @@ public function bootingPackage()
Scramble::configure()->expose(false);
}

$this->app->booted(function (Application $app) {
Scramble::configure()
->withParametersExtractors(function (ParametersExtractors $parametersExtractors) {
$parametersExtractors->append([
MethodCallsParametersExtractor::class,
AttributesParametersExtractor::class,
]);
});

$this->app->booted(function () {
$this->registerRoutes();
});
}
Expand Down

0 comments on commit 7ce4425

Please sign in to comment.