openapi-generator icon indicating copy to clipboard operation
openapi-generator copied to clipboard

[REQ] Provide option to generate QueryParameter from model types in JavaSpring generator

Open dickerpulli opened this issue 7 months ago • 0 comments

Is your feature request related to a problem? Please describe.

I have this definition of request parameter in openapi xml

        - in: query
          name: listQueryParams
          required: true
          schema:
            $ref: '#/components/schemas/ListQueryParams' 

When I generate API (generator: spring) from this file the generated API interface does not have an annotation @QueryParameter on the method parameter. As I see in the modules/openapi-generator/src/main/resources/JavaSpring/queryParams.mustache the @QueryParameter is only added if isModel is false.

Describe the solution you'd like

Models should also be used as query parameters so the annotation @QueryParameters should be generated then, too.

Describe alternatives you've considered

Only alternative is to create a POST endpoint and use the query parameters object as body.

Additional context

dickerpulli avatar Jun 10 '25 17:06 dickerpulli