Skip to content

Commit

Permalink
Postman collection export: encoding value to prevent validation errors (
Browse files Browse the repository at this point in the history
#888)

* encoded value before putting into postman structure to prevent validation errors

* apply urlencoding just if value is not a string

* replaced urlencode with strval
  • Loading branch information
eschricker authored Sep 15, 2024
1 parent 02f4f3f commit 3ab4ae7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Writing/PostmanCollectionWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ protected function generateUrlObject(OutputEndpointData $endpointData): array
// See https://www.php.net/manual/en/function.parse-str.php
$query[] = [
'key' => "{$name}[$index]",
'value' => $value,
'value' => is_string($value) ? $value : strval($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

0 comments on commit 3ab4ae7

Please sign in to comment.