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] Description spring generator not compatible with latest 3.4.0 GA #20174

Open
3 of 6 tasks
davidkarlsen opened this issue Nov 25, 2024 · 1 comment
Open
3 of 6 tasks

Comments

@davidkarlsen
Copy link

davidkarlsen commented Nov 25, 2024

Bug Report Checklist

  • Have you provided a full/minimal spec to reproduce the issue?
  • Have you validated the input using an OpenAPI validator (example)?
  • Have you tested with the latest master to confirm the issue still exists?
  • Have you searched for related issues/PRs?
  • What's the actual output vs expected output?
  • [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

When generating code with latest maven plugin 7.10.0 it will generate non-compilable code.

openapi-generator version

7.10.0

OpenAPI declaration file content or url
 <plugin>
        <groupId>org.openapitools</groupId>
        <artifactId>openapi-generator-maven-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <inputSpec>${project.basedir}/src/main/resources/bring/bring-postalcode-api-contract.yml</inputSpec>
              <skipValidateSpec>true</skipValidateSpec>
              <generatorName>spring</generatorName>
              <library>spring-http-interface</library>
              <apiPackage>org.mypkg.clients.bring.generated.api</apiPackage>
              <configOptions>
                <!-- see https://github.com/OpenAPITools/openapi-generator/releases/tag/v6.5.0 - conflicts with lombok -->
                <sourceFolder>src/gen/java/main</sourceFolder>
                <dateLibrary>java8</dateLibrary>
                <useTags>true</useTags>
              </configOptions>
            </configuration>
          </execution>
        </executions>
      </plugin>
Generation Details
Steps to reproduce

Use above config and use spring-boot 3.4.0. The actual openapi in question shouldn't match too much.

Related issues/PRs

#19712

Suggest a fix
HttpServiceProxyFactory.builder().build().createClient(PostalCodeApi.class);

instead of

        HttpServiceProxyFactory factory = HttpServiceProxyFactory.builder(WebClientAdapter.forClient(webClient)).build();
@davidkarlsen
Copy link
Author

one can avoid this code to be generated by setting flag:

<generateSupportingFiles>false</generateSupportingFiles>

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