Skip to content

Commit

Permalink
Experimental: don't URL-encode Postman query parameters (closes #442)
Browse files Browse the repository at this point in the history
  • Loading branch information
shalvah committed Mar 19, 2023
1 parent ea34186 commit df4d86f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Writing/PostmanCollectionWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,8 @@ protected function generateUrlObject(OutputEndpointData $endpointData): array
// Going with the first to also support object query parameters
// See https://www.php.net/manual/en/function.parse-str.php
$query[] = [
'key' => urlencode("{$name}[$index]"),
'value' => urlencode($value),
'key' => "{$name}[$index]",
'value' => $value,
'description' => strip_tags($parameterData->description),
// Default query params to disabled if they aren't required and have empty values
'disabled' => !$parameterData->required && empty($parameterData->example),
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/PostmanCollectionWriterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,13 @@ public function query_parameters_are_documented()
'disabled' => false,
], $variableData[0]);
$this->assertEquals([
'key' => urlencode('filters[0]'),
'key' => 'filters[0]',
'value' => '34',
'description' => 'Filters',
'disabled' => false,
], $variableData[1]);
$this->assertEquals([
'key' => urlencode('filters[1]'),
'key' => 'filters[1]',
'value' => '12',
'description' => 'Filters',
'disabled' => false,
Expand Down

0 comments on commit df4d86f

Please sign in to comment.