Просмотр исходного кода

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 9 месяцев назад
Родитель
Сommit
3ab4ae7029
1 измененных файлов с 1 добавлено и 1 удалено
  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),