@@ -34,6 +34,8 @@ class SymfonyControllerVisitor extends ConverterVisitor
3434
3535    public  function  __construct (
3636        private  ?FilterInterface $ filter
37+         private  string  $ queryStringAttributeName'Query ' ,
38+         private  string  $ requestBodyAttributeName'Input ' ,
3739    ) {
3840        $ this converterResult  = new  ConverterResult ();
3941        $ this phpDocTypeParser  = new  PhpDocTypeParser ();
@@ -150,21 +152,21 @@ private function createApiEndpoint(ClassMethod $node): void
150152        /** @var string[] $excessiveRouteParams */ 
151153        $ excessiveRouteParamsarray_flip ($ routeParams
152154        foreach  ($ nodeparams  as  $ param
153-             $ maybeDtoInputAttribute$ this findAttribute ($ param' Input ' 
155+             $ maybeDtoInputAttribute$ this findAttribute ($ param$ this -> requestBodyAttributeName );
154156            if  ($ maybeDtoInputAttribute
155157                if  ($ inputParam
156-                     throw  new  Exception (' Multiple #[Input ] on controller action are not supported ' 
158+                     throw  new  Exception (sprintf ( " Multiple #[%s ] on controller action are not supported " ,  $ this -> requestBodyAttributeName ) );
157159                }
158160                $ inputParamnew  ApiEndpointParam (
159161                    name: $ paramvar ->name ,
160162                    // TODO: class names with full namespace probably aren't supported 
161163                    type: PhpTypeFactory::create ($ paramtype ->getParts ()[0 ]),
162164                );
163165            }
164-             $ maybeDtoQueryAttribute$ this findAttribute ($ param' Query ' 
166+             $ maybeDtoQueryAttribute$ this findAttribute ($ param$ this -> queryStringAttributeName );
165167            if  ($ maybeDtoQueryAttribute
166168                if  (!empty ($ queryParams
167-                     throw  new  Exception (' Multiple #[Query ] on controller action are not supported ' 
169+                     throw  new  Exception (sprintf ( " Multiple #[%s ] on controller action are not supported " ,  $ this -> queryStringAttributeName ) );
168170                }
169171                $ queryParamsnew  ApiEndpointParam (
170172                    name: $ paramvar ->name ,
0 commit comments