|
@@ -117,8 +117,8 @@ class PostmanCollectionWriter
|
|
protected function makeUrlData($route)
|
|
protected function makeUrlData($route)
|
|
{
|
|
{
|
|
// URL Parameters are collected by the `UrlParameters` strategies, but only make sense if they're in the route
|
|
// URL Parameters are collected by the `UrlParameters` strategies, but only make sense if they're in the route
|
|
- // definition. Filter out any URL parameters that don't appear in the URL, and assume they're query params.
|
|
|
|
- [$urlParams, $queryParams] = collect($route['urlParameters'])->partition(function ($_, $key) use ($route) {
|
|
|
|
|
|
+ // definition. Filter out any URL parameters that don't appear in the URL.
|
|
|
|
+ $urlParams = collect($route['urlParameters'])->filter(function ($_, $key) use ($route) {
|
|
return Str::contains($route['uri'], '{'.$key.'}');
|
|
return Str::contains($route['uri'], '{'.$key.'}');
|
|
});
|
|
});
|
|
|
|
|
|
@@ -130,7 +130,7 @@ class PostmanCollectionWriter
|
|
'path' => preg_replace_callback('/\/{(\w+)\??}(?=\/|$)/', function ($matches) {
|
|
'path' => preg_replace_callback('/\/{(\w+)\??}(?=\/|$)/', function ($matches) {
|
|
return '/:'.$matches[1];
|
|
return '/:'.$matches[1];
|
|
}, $route['uri']),
|
|
}, $route['uri']),
|
|
- 'query' => $queryParams->union($route['queryParameters'])->map(function ($parameter, $key) {
|
|
|
|
|
|
+ 'query' => collect($route['queryParameters'])->map(function ($parameter, $key) {
|
|
return [
|
|
return [
|
|
'key' => $key,
|
|
'key' => $key,
|
|
'value' => urlencode($parameter['value']),
|
|
'value' => urlencode($parameter['value']),
|