diff --git a/src/Extracting/ParamHelpers.php b/src/Extracting/ParamHelpers.php index 82f25213..bed26185 100644 --- a/src/Extracting/ParamHelpers.php +++ b/src/Extracting/ParamHelpers.php @@ -46,7 +46,7 @@ protected function getDummyValueGenerator(string $type, int $size = null): \Clos 'integer' => fn() => $size ?: $faker->numberBetween(1, 20), 'number' => fn() => $size ?: $faker->randomFloat(), 'boolean' => fn() => $faker->boolean(), - 'string' => fn() => $size ? $faker->lexify(str_repeat("?", $size)) : $faker->word, + 'string' => fn() => $size ? $faker->lexify(str_repeat("?", $size)) : $faker->word(), 'object' => fn() => [], 'file' => fn() => UploadedFile::fake()->create('test.jpg')->size($size ?: 10), ]; diff --git a/src/Writing/PostmanCollectionWriter.php b/src/Writing/PostmanCollectionWriter.php index 03b7e0e0..576405f2 100644 --- a/src/Writing/PostmanCollectionWriter.php +++ b/src/Writing/PostmanCollectionWriter.php @@ -258,7 +258,7 @@ protected function generateUrlObject(OutputEndpointData $endpointData): array } else { $query[] = [ 'key' => urlencode($name), - 'value' => urlencode($parameterData->example), + 'value' => $parameterData->example != null ? urlencode($parameterData->example) : '', '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), diff --git a/tests/Unit/OpenAPISpecWriterTest.php b/tests/Unit/OpenAPISpecWriterTest.php index 86a1a6cc..39c730fc 100644 --- a/tests/Unit/OpenAPISpecWriterTest.php +++ b/tests/Unit/OpenAPISpecWriterTest.php @@ -509,7 +509,7 @@ public function adds_responses_correctly_as_responses_on_operation_object() protected function createMockEndpointData(array $custom = []): OutputEndpointData { $faker = Factory::create(); - $path = '/' . $faker->word; + $path = '/' . $faker->word(); $data = [ 'uri' => $path, 'httpMethods' => $faker->randomElements(['GET', 'POST', 'PUT', 'PATCH', 'DELETE'], 1), @@ -517,9 +517,9 @@ protected function createMockEndpointData(array $custom = []): OutputEndpointDat 'Content-Type' => 'application/json', ], 'metadata' => [ - 'title' => $faker->sentence, - 'description' => $faker->randomElement([$faker->sentence, '']), - 'authenticated' => $faker->boolean, + 'title' => $faker->sentence(), + 'description' => $faker->randomElement([$faker->sentence(), '']), + 'authenticated' => $faker->boolean(), ], 'urlParameters' => [], // Should be set by caller (along with custom path) 'queryParameters' => [],