diff --git a/tests/Generator/Request/ParametersDocumentationTest.php b/tests/Generator/Request/ParametersDocumentationTest.php index be01da34..87790ff9 100644 --- a/tests/Generator/Request/ParametersDocumentationTest.php +++ b/tests/Generator/Request/ParametersDocumentationTest.php @@ -69,18 +69,17 @@ public function __invoke(Request $request) it('supports optional parameters', function () { $openApiDocument = generateForRoute(fn () => RouteFacade::get('api/test/{param?}', SupportOptionalParam_ParametersDocumentationTestController::class)); - dd($openApiDocument); - - expect($openApiDocument['paths']['/test']['get']['parameters']) + expect($openApiDocument['paths']['/test/{param}']['get']['parameters']) ->toHaveCount(1) - ->and($openApiDocument['paths']['/test']['get']['parameters'][0]) + ->and($openApiDocument['paths']['/test/{param}']['get']['parameters'][0]) ->toBe([ - 'name' => 'foo', - 'in' => 'query', + 'name' => 'param', + 'in' => 'path', 'required' => true, + 'description' => '**Optional**. The name of the person to greet', 'schema' => [ - 'type' => 'string', - 'format' => 'uuid', + 'type' => ['string', 'null'], + 'default' => 'foo', ], ]); });