@@ -302,7 +302,7 @@ private function loadProductFixtures(string $resourceClass): void
302302 }
303303
304304 #[DataProvider('openApiParameterDocumentationProvider ' )]
305- public function testOpenApiParameterDocumentation (string $ parameterName , bool $ shouldHaveArrayNotation , string $ expectedStyle , bool $ expectedExplode , ?string $ expectedSchemaType = null ): void
305+ public function testOpenApiParameterDocumentation (string $ parameterName , bool $ shouldHaveArrayNotation , string $ expectedStyle , bool $ expectedExplode , ?string $ expectedSchemaType = null , string $ expectedDescription = '' ): void
306306 {
307307 if ($ this ->isMongoDB ()) {
308308 $ this ->markTestSkipped ('Not tested with mongodb. ' );
@@ -339,6 +339,7 @@ public function testOpenApiParameterDocumentation(string $parameterName, bool $s
339339 $ this ->assertSame ($ expectedSchemaType , $ foundParameter ['schema ' ]['type ' ], \sprintf ('Parameter schema type should be %s ' , $ expectedSchemaType ));
340340 }
341341
342+ $ this ->assertSame ($ expectedDescription , $ foundParameter ['description ' ] ?? '' , \sprintf ('Description should be %s ' , $ expectedDescription ));
342343 $ this ->assertSame ($ expectedStyle , $ foundParameter ['style ' ] ?? 'form ' , \sprintf ('Style should be %s ' , $ expectedStyle ));
343344 $ this ->assertSame ($ expectedExplode , $ foundParameter ['explode ' ] ?? false , \sprintf ('Explode should be %s ' , $ expectedExplode ? 'true ' : 'false ' ));
344345 }
@@ -353,6 +354,14 @@ public static function openApiParameterDocumentationProvider(): array
353354 'expectedExplode ' => true ,
354355 'expectedSchemaType ' => 'string ' ,
355356 ],
357+ 'default behavior with an extra description ' => [
358+ 'parameterName ' => 'brandWithDescription ' ,
359+ 'shouldHaveArrayNotation ' => true ,
360+ 'expectedStyle ' => 'deepObject ' ,
361+ 'expectedExplode ' => true ,
362+ 'expectedSchemaType ' => 'string ' ,
363+ 'expectedDescription ' => 'Extra description about the filter ' ,
364+ ],
356365 'explicit schema type string should not use array notation ' => [
357366 'parameterName ' => 'exactBrand ' ,
358367 'shouldHaveArrayNotation ' => false ,
0 commit comments