diff --git a/resources/views/partials/example-requests/bash.blade.php b/resources/views/partials/example-requests/bash.blade.php index b7713641..5237be86 100644 --- a/resources/views/partials/example-requests/bash.blade.php +++ b/resources/views/partials/example-requests/bash.blade.php @@ -1,7 +1,6 @@ ```bash curl -X {{$route['methods'][0]}} \ - {{$route['methods'][0] == 'GET' ? '-G ' : ''}}"{{ rtrim($baseUrl, '/')}}/{{ ltrim($route['boundUri'], '/') }}@if(count($route['cleanQueryParameters']))?{!! \Mpociot\ApiDoc\Tools\Utils::printQueryParamsAsString($route['cleanQueryParameters']) !!} -@endif" @if(count($route['headers']))\ + {{$route['methods'][0] == 'GET' ? '-G ' : ''}}"{{ rtrim($baseUrl, '/')}}/{{ ltrim($route['boundUri'], '/') }}@if(count($route['cleanQueryParameters']))?{!! \Mpociot\ApiDoc\Tools\Utils::printQueryParamsAsString($route['cleanQueryParameters']) !!}@endif" @if(count($route['headers']))\ @foreach($route['headers'] as $header => $value) -H "{{$header}}: {{ addslashes($value) }}"@if(! ($loop->last) || ($loop->last && count($route['bodyParameters']))) \ @endif diff --git a/src/Tools/Utils.php b/src/Tools/Utils.php index 121ecb1d..bc35c94f 100644 --- a/src/Tools/Utils.php +++ b/src/Tools/Utils.php @@ -90,6 +90,7 @@ public static function dumpException(\Exception $e) public static function deleteDirectoryAndContents($dir) { + $dir = ltrim($dir, "/"); $adapter = new Local(realpath(__DIR__ . '/../../')); $fs = new Filesystem($adapter); $fs->deleteDir($dir); diff --git a/tests/Fixtures/index.md b/tests/Fixtures/index.md index a82b6805..1c2fe91a 100644 --- a/tests/Fixtures/index.md +++ b/tests/Fixtures/index.md @@ -233,7 +233,7 @@ let params = { "user_id": "me", "page": "4", "filters": "consequatur", - "url_encoded": "+ []&=", + "url_encoded": "+ []&=", }; Object.keys(params) .forEach(key => url.searchParams.append(key, params[key]));