@@ -65,15 +65,19 @@ protected function augmentParameters(Analysis $analysis): void
6565 }
6666
6767 if ($ context ->reflector instanceof \ReflectionParameter) {
68- $ schema = new OA \Schema (['_context ' => new Context (['reflector ' => $ context ->reflector ], $ context )]);
69- $ this ->generator ->getTypeResolver ()->augmentSchemaType ($ analysis , $ schema );
70-
71- $ parameter ->merge ([new OA \Schema ([
72- 'type ' => $ schema ->type ,
73- 'format ' => $ schema ->format ,
74- 'ref ' => $ schema ->ref ,
75- '_context ' => new Context (['nested ' => $ this , 'comment ' => null , 'reflector ' => $ context ->reflector ], $ context )]),
76- ]);
68+ if (Generator::isDefault ($ parameter ->schema )) {
69+ $ schema = new OA \Schema (['_context ' => new Context (['reflector ' => $ context ->reflector ], $ context )]);
70+ $ this ->generator ->getTypeResolver ()->augmentSchemaType ($ analysis , $ schema );
71+
72+ $ parameter ->merge ([new OA \Schema ([
73+ 'type ' => $ schema ->type ,
74+ 'format ' => $ schema ->format ,
75+ 'ref ' => $ schema ->ref ,
76+ '_context ' => new Context (['nested ' => $ this , 'comment ' => null , 'reflector ' => $ context ->reflector ], $ context )]),
77+ ]);
78+ } else {
79+ $ schema = $ parameter ->schema ;
80+ }
7781
7882 if (Generator::isDefault ($ parameter ->required )) {
7983 $ parameter ->required = !$ schema ->isNullable ();
0 commit comments