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

javax.servlet is still used even when "jakarta" is set to true #1167

Closed
tgillain opened this issue Jun 8, 2023 · 4 comments
Closed

javax.servlet is still used even when "jakarta" is set to true #1167

tgillain opened this issue Jun 8, 2023 · 4 comments

Comments

@tgillain
Copy link
Contributor

tgillain commented Jun 8, 2023

Hello,

We are currently migrating our project from springboot 2.7.x to 3.0.x.
When using the plugin configuration below that used to work with spring 2.7.x and adding true, the generated ***Api.java is still containing a reference to import javax.servlet.http.HttpServletRequest;

I manage to make it work by slightly changing the src/main/resources/handlebars/JavaSpring/api.mustache to also take into account the 'jakarta' parameter.

Could you please indicate if I am doing something wrong or if I can contribute to the project by pushing this change ?

Brs.
Th.

The proposed change :
{{#jdk8-no-delegate}} {{#jakarta}} import jakarta.servlet.http.HttpServletRequest; {{/jakarta}} {{^jakarta}} import javax.servlet.http.HttpServletRequest; {{/jakarta}} {{/jdk8-no-delegate}}

The used plugin configuration :
<plugin> <groupId>io.swagger.codegen.v3</groupId> <artifactId>swagger-codegen-maven-plugin</artifactId> <version>1.0.46</version> <executions> <execution> <goals> <goal>generate</goal> </goals> <configuration> <inputSpec>${open-api-spec}</inputSpec> <language>spring</language> <apiPackage>${apipackage}</apiPackage> <modelPackage>${modelPackage}</modelPackage> <generateApiTests>false</generateApiTests> <configOptions> <java8>true</java8> <async>true</async> <interfaceOnly>true</interfaceOnly> <jakarta>true</jakarta> </configOptions> </configuration> </execution> </executions> </plugin>

@tgillain
Copy link
Contributor Author

tgillain commented Jun 8, 2023

Just in case, I already created PR (#1168)

@radarsh
Copy link
Contributor

radarsh commented Aug 15, 2023

@HugoMario @frantuma can this be merged and released please? Without this, we have to duplicate the api.mustache in all our projects.

@tgillain
Copy link
Contributor Author

From our side since this was really blocking we in the end migrated to openapi-generator-maven-plugin

@HugoMario
Copy link
Contributor

handled by #1168

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

No branches or pull requests

3 participants