Skip to content

Commit

Permalink
Merge pull request #318 from Redtama/allow-body-params-on-get-requests
Browse files Browse the repository at this point in the history
Removed the check that prevented GET endpoint handlers from supportin…
  • Loading branch information
shalvah authored Sep 9, 2021
2 parents 2ff7c29 + abf6ecc commit f8fe1cb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/Extracting/Extractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,6 @@ protected function fetchQueryParameters(ExtractedEndpointData $endpointData, arr

protected function fetchBodyParameters(ExtractedEndpointData $endpointData, array $rulesToApply): void
{
if (in_array('GET', $endpointData->httpMethods)) {
return;
}
$this->iterateThroughStrategies('bodyParameters', $endpointData, $rulesToApply, function ($results) use ($endpointData) {
foreach ($results as $key => $item) {
if (empty($item['name'])) {
Expand Down
4 changes: 4 additions & 0 deletions tests/Unit/ExtractorPluginSystemTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public function responses_from_different_strategies_get_added()
{
$config = [
'strategies' => [
'bodyParameters' => [],
'responses' => [DummyResponseStrategy200::class, DummyResponseStrategy400::class],
],
];
Expand Down Expand Up @@ -94,6 +95,7 @@ public function combines_results_from_different_strategies_in_same_stage()
$config = [
'strategies' => [
'metadata' => [PartialDummyMetadataStrategy1::class, PartialDummyMetadataStrategy2::class],
'bodyParameters' => [],
'responses' => [],
],
];
Expand All @@ -117,6 +119,7 @@ public function missing_metadata_is_filled_in()
$config = [
'strategies' => [
'metadata' => [PartialDummyMetadataStrategy2::class],
'bodyParameters' => [],
'responses' => [],
],
];
Expand All @@ -140,6 +143,7 @@ public function overwrites_metadata_from_previous_strategies_in_same_stage()
$config = [
'strategies' => [
'metadata' => [NotDummyMetadataStrategy::class, PartialDummyMetadataStrategy1::class],
'bodyParameters' => [],
'responses' => [],
],
];
Expand Down

0 comments on commit f8fe1cb

Please sign in to comment.