Skip to content

[BUG][Spring] x-spring-paginated fails if no params is defined in the operation #15265

@ilopezv

Description

@ilopezv

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
    • swagger.txt (openapi 2.0.0) in oas3 we hava the same problem
  • Have you validated the input using an OpenAPI validator (example)?
    • yes
  • Have you tested with the latest master to confirm the issue still exists?
    • All 6.x versions up to 6.5.0 included
  • Have you searched for related issues/PRs?
    • yes
  • What's the actual output vs expected output?
    • In class PrestacionesApiDelegate interface methods should be : obtenerDatosEncuestaDecesos(final Pageable pageable); not obtenerDatosEncuestaDecesos(, final Pageable pageable);
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

When using generator spring/spring-cloud and delegatePattern is active:

                <generatorName>spring</generatorName>
                <library>spring-cloud</library>
                <configOptions>
                  <delegatePattern>true</delegatePattern>
                </configOptions>

And try to compile an oas2/oas3 spec with x-spring-paginated: true and no params, generator fails due to the template is introducing a "," prior to Pageable object
obtenerDatosEncuestaDecesos(, final Pageable pageable);

The problem seems to came from this point at apiDelegate.mustache where the "," is introduced always

openapi-generator version

All 6.x versions up to 6.5.0 included

OpenAPI declaration file content or url

swagger.txt

Generation Details
                <generatorName>spring</generatorName>
                <library>spring-cloud</library>
                <configOptions>
                  <delegatePattern>true</delegatePattern>
                </configOptions>
Steps to reproduce
Related issues/PRs

N/A

Suggest a fix

check if no params is defined, and remove "," in this cases.
Problem came from this line in apiDelegate.mustache where the "," is introduced always

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions