Skip to content

Commit 052511a

Browse files
committed
add jakarta implementation
#1054
1 parent 701b295 commit 052511a

File tree

72 files changed

+583
-105
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+583
-105
lines changed

src/main/resources/handlebars/JavaInflector/api.mustache

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@ package {{invokerPackage}};
22

33
import io.swagger.oas.inflector.models.RequestContext;
44
import io.swagger.oas.inflector.models.ResponseContext;
5+
{{#jakarta}}
6+
import jakarta.ws.rs.core.Response.Status;
7+
{{/jakarta}}
8+
{{^jakarta}}
59
import javax.ws.rs.core.Response.Status;
10+
{{/jakarta}}
611

712
import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
813
import java.io.File;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{{^hideGenerationTimestamp}}@javax.annotation.Generated(value = "{{generatorClass}}", date = "{{generatedDate}}"){{/hideGenerationTimestamp}}
1+
{{^hideGenerationTimestamp}}@{{#jakarta}}jakarta{{/jakarta}}{{^jakarta}}javax{{/jakarta}}.annotation.Generated(value = "{{generatorClass}}", date = "{{generatedDate}}"){{/hideGenerationTimestamp}}

src/main/resources/handlebars/JavaInflector/web.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<servlet-name>swagger-inflector</servlet-name>
55
<servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
66
<init-param>
7-
<param-name>javax.ws.rs.Application</param-name>
7+
<param-name>{{#jakarta}}jakarta{{/jakarta}}javax{{^jakarta}}.ws.rs.Application</param-name>
88
<param-value>io.swagger.oas.inflector.OpenAPIInflector</param-value>
99
</init-param>
1010
<load-on-startup>1</load-on-startup>
@@ -21,4 +21,4 @@
2121
<filter-name>CORSFilter</filter-name>
2222
<url-pattern>/*</url-pattern>
2323
</filter-mapping>
24-
</web-app>
24+
</web-app>

src/main/resources/handlebars/JavaJaxRS/ApiOriginFilter.mustache

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,17 @@ package {{apiPackage}};
22

33
import java.io.IOException;
44

5+
{{#jakarta}}
6+
import jakarta.servlet.*;
7+
import jakarta.servlet.http.HttpServletResponse;
8+
{{/jakarta}}
9+
{{^jakarta}}
510
import javax.servlet.*;
611
import javax.servlet.http.HttpServletResponse;
12+
{{/jakarta}}
713

814
{{>generatedAnnotation}}
9-
public class ApiOriginFilter implements javax.servlet.Filter {
15+
public class ApiOriginFilter implements Filter {
1016
public void doFilter(ServletRequest request, ServletResponse response,
1117
FilterChain chain) throws IOException, ServletException {
1218
HttpServletResponse res = (HttpServletResponse) response;
@@ -19,4 +25,4 @@ public class ApiOriginFilter implements javax.servlet.Filter {
1925
public void destroy() {}
2026

2127
public void init(FilterConfig filterConfig) throws ServletException {}
22-
}
28+
}

src/main/resources/handlebars/JavaJaxRS/ApiResponseMessage.mustache

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
package {{apiPackage}};
22

3+
{{#jakarta}}
4+
import jakarta.xml.bind.annotation.XmlTransient;
5+
6+
@jakarta.xml.bind.annotation.XmlRootElement
7+
{{/jakarta}}
8+
{{^jakarta}}
39
import javax.xml.bind.annotation.XmlTransient;
410

511
@javax.xml.bind.annotation.XmlRootElement
12+
{{/jakarta}}
613
{{>generatedAnnotation}}
714
public class ApiResponseMessage {
815
public static final int ERROR = 1;

src/main/resources/handlebars/JavaJaxRS/JodaDateTimeProvider.mustache

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,24 @@ import com.sun.jersey.core.spi.component.ComponentContext;
44
import com.sun.jersey.spi.inject.Injectable;
55
import com.sun.jersey.spi.inject.PerRequestTypeInjectableProvider;
66

7+
{{#jakarta}}
8+
import jakarta.ws.rs.QueryParam;
9+
import jakarta.ws.rs.WebApplicationException;
10+
import jakarta.ws.rs.core.Context;
11+
import jakarta.ws.rs.core.Response;
12+
import jakarta.ws.rs.core.Response.Status;
13+
import jakarta.ws.rs.core.UriInfo;
14+
import jakarta.ws.rs.ext.Provider;
15+
{{/jakarta}}
16+
{{^jakarta}}
717
import javax.ws.rs.QueryParam;
818
import javax.ws.rs.WebApplicationException;
919
import javax.ws.rs.core.Context;
1020
import javax.ws.rs.core.Response;
1121
import javax.ws.rs.core.Response.Status;
1222
import javax.ws.rs.core.UriInfo;
1323
import javax.ws.rs.ext.Provider;
24+
{{/jakarta}}
1425
import org.joda.time.DateTime;
1526
import java.util.List;
1627

@@ -41,4 +52,4 @@ public class JodaDateTimeProvider extends PerRequestTypeInjectableProvider<Query
4152
}
4253
};
4354
}
44-
}
55+
}

src/main/resources/handlebars/JavaJaxRS/JodaLocalDateProvider.mustache

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,24 @@ import com.sun.jersey.core.spi.component.ComponentContext;
44
import com.sun.jersey.spi.inject.Injectable;
55
import com.sun.jersey.spi.inject.PerRequestTypeInjectableProvider;
66

7+
{{#jakarta}}
8+
import jakarta.ws.rs.QueryParam;
9+
import jakarta.ws.rs.WebApplicationException;
10+
import jakarta.ws.rs.core.Context;
11+
import jakarta.ws.rs.core.Response;
12+
import jakarta.ws.rs.core.Response.Status;
13+
import jakarta.ws.rs.core.UriInfo;
14+
import jakarta.ws.rs.ext.Provider;
15+
{{/jakarta}}
16+
{{^jakarta}}
717
import javax.ws.rs.QueryParam;
818
import javax.ws.rs.WebApplicationException;
919
import javax.ws.rs.core.Context;
1020
import javax.ws.rs.core.Response;
1121
import javax.ws.rs.core.Response.Status;
1222
import javax.ws.rs.core.UriInfo;
1323
import javax.ws.rs.ext.Provider;
24+
{{/jakarta}}
1425
import org.joda.time.LocalDate;
1526
import java.util.List;
1627

@@ -41,4 +52,4 @@ public class JodaLocalDateProvider extends PerRequestTypeInjectableProvider<Quer
4152
}
4253
};
4354
}
44-
}
55+
}

src/main/resources/handlebars/JavaJaxRS/api.mustache

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,27 @@ import java.io.InputStream;
3232
import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
3333
import org.glassfish.jersey.media.multipart.FormDataParam;
3434

35+
{{#jakarta}}
36+
import jakarta.servlet.ServletConfig;
37+
import jakarta.ws.rs.core.Context;
38+
import jakarta.ws.rs.core.Response;
39+
import jakarta.ws.rs.core.SecurityContext;
40+
import jakarta.ws.rs.*;
41+
{{/jakarta}}
42+
{{^jakarta}}
3543
import javax.servlet.ServletConfig;
3644
import javax.ws.rs.core.Context;
3745
import javax.ws.rs.core.Response;
3846
import javax.ws.rs.core.SecurityContext;
3947
import javax.ws.rs.*;
48+
{{/jakarta}}
4049
{{#useBeanValidation}}
50+
{{#jakarta}}
51+
import jakarta.validation.constraints.*;
52+
{{/jakarta}}
53+
{{^jakarta}}
4154
import javax.validation.constraints.*;
55+
{{/jakarta}}
4256
{{/useBeanValidation}}
4357

4458
{{#apiBasePath}}@Path("/{{{apiBasePath}}}"){{/apiBasePath}}

src/main/resources/handlebars/JavaJaxRS/apiService.mustache

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,21 @@ import {{package}}.NotFoundException;
1414

1515
import java.io.InputStream;
1616

17+
{{#jakarta}}
18+
import jakarta.ws.rs.core.Response;
19+
import jakarta.ws.rs.core.SecurityContext;
20+
{{/jakarta}}
21+
{{^jakarta}}
1722
import javax.ws.rs.core.Response;
1823
import javax.ws.rs.core.SecurityContext;
24+
{{/jakarta}}
1925
{{#useBeanValidation}}
26+
{{#jakarta}}
27+
import jakarta.validation.constraints.*;
28+
{{/jakarta}}
29+
{{^jakarta}}
2030
import javax.validation.constraints.*;
31+
{{/jakarta}}
2132
{{/useBeanValidation}}
2233
{{>generatedAnnotation}}
2334
{{#operations}}

src/main/resources/handlebars/JavaJaxRS/apiServiceImpl.mustache

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,21 @@ import java.io.InputStream;
1414

1515
import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
1616

17+
{{#jakarta}}
18+
import jakarta.ws.rs.core.Response;
19+
import jakarta.ws.rs.core.SecurityContext;
20+
{{/jakarta}}
21+
{{^jakarta}}
1722
import javax.ws.rs.core.Response;
1823
import javax.ws.rs.core.SecurityContext;
24+
{{/jakarta}}
1925
{{#useBeanValidation}}
26+
{{#jakarta}}
2027
import javax.validation.constraints.*;
28+
{{/jakarta}}
29+
{{^jakarta}}
30+
import javax.validation.constraints.*;
31+
{{/jakarta}}
2132
{{/useBeanValidation}}
2233
{{>generatedAnnotation}}
2334
{{#operations}}

0 commit comments

Comments
 (0)