Browse Source

Postman collection export: encoding value to prevent validation errors (#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
eschricker 7 months ago
parent
commit
3ab4ae7029
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/Writing/PostmanCollectionWriter.php

+ 1 - 1
src/Writing/PostmanCollectionWriter.php

@@ -293,7 +293,7 @@ class PostmanCollectionWriter
                     // 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),