Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
5 of 9 tasks
ilopezv opened this issue Apr 19, 2023 · 0 comments
Closed
5 of 9 tasks

Comments

@ilopezv
Copy link

ilopezv commented Apr 19, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant