This is an automated email from the ASF dual-hosted git repository.
Lukas-Finster pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
The following commit(s) were added to refs/heads/trunk by this push:
new 3d36a669fc Fixed: migrates rest-api dependencys from javax to jakarta
(OFBIZ-13489)
3d36a669fc is described below
commit 3d36a669fc7c1acbe62c226ff533b8b6fd88b554
Author: Lukas Finster <[email protected]>
AuthorDate: Tue Aug 11 12:38:41 2026 +0200
Fixed: migrates rest-api dependencys from javax to jakarta (OFBIZ-13489)
* This fixes an issue with auth/token resource not beeing discovered by
the scanner used by OFBizOpenApiReader, resulting in auth endpoint not
showing up in swagger UI
---
.../ws/rs/resources/AuthenticationResource.java | 22 ++++++++++++++++++++--
gradle/libs.versions.toml | 8 ++++----
2 files changed, 24 insertions(+), 6 deletions(-)
diff --git
a/framework/rest-api/src/main/java/org/apache/ofbiz/ws/rs/resources/AuthenticationResource.java
b/framework/rest-api/src/main/java/org/apache/ofbiz/ws/rs/resources/AuthenticationResource.java
index f0fffab9b3..799c88346f 100644
---
a/framework/rest-api/src/main/java/org/apache/ofbiz/ws/rs/resources/AuthenticationResource.java
+++
b/framework/rest-api/src/main/java/org/apache/ofbiz/ws/rs/resources/AuthenticationResource.java
@@ -31,6 +31,9 @@ import org.apache.ofbiz.ws.rs.util.RestApiUtil;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
+import io.swagger.v3.oas.annotations.media.Content;
+import io.swagger.v3.oas.annotations.media.ExampleObject;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.ServletContext;
@@ -87,8 +90,23 @@ public class AuthenticationResource {
@Produces(MediaType.APPLICATION_JSON)
@Path("/token")
@AuthToken
- @Operation(security = @SecurityRequirement(name = "basicAuth"),
- operationId = "getAuthToken", description = "Generates JWT token
for subsequent API calles.")
+ @Operation(security = @SecurityRequirement(name = "basicAuth"),
operationId = "getAuthToken",
+ description = "Generates JWT token for subsequent API calls.",
+ responses = {
+ @ApiResponse(responseCode = "200", description = "OK,
token generated.",
+ content = @Content(mediaType = "application/json",
+ examples = @ExampleObject(value = "{
\"statusCode\" : 200, \"statusDescription\" : \"OK\", "
+ + "\"successMessage\" : \"Token granted.\",
\"data\" : { \"access_token\" : \"eyJ0eXAiOi...Ha3lpL19ag\", "
+ + "\"token_type\" : \"Bearer\", \"expires_in\" :
\"86400000\" } }"))),
+ @ApiResponse(responseCode = "401", description =
"Unauthorized.",
+ content = @Content(mediaType = "application/json",
+ examples = @ExampleObject(value = "{
\"statusCode\" : 401, \"statusDescription\" : \"Unauthorized\", "
+ + "\"errorMessage\" : \"Unauthorized: Access is
denied due to invalid or absent Authorization header\" }"))),
+ @ApiResponse(responseCode = "403", description =
"Forbidden.",
+ content = @Content(mediaType = "application/json",
+ examples = @ExampleObject(value = "{
\"statusCode\" : 403, \"statusDescription\" : \"Forbidden\", "
+ + "\"errorMessage\" : \"Access Denied: User not
found.\" }")))
+ })
public Response getAuthToken(@Parameter(in = ParameterIn.HEADER, name =
"Authorization",
description = "Authorization header using Basic Authentication",
example = HttpHeaders.AUTHORIZATION + ": Basic YWRtaW46b2ZiaXo=")
@HeaderParam(HttpHeaders.AUTHORIZATION) String creds) {
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index 0f64d7af0e..d0b2a38e84 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -86,7 +86,7 @@ spring = "6.2.18"
jackson-databind = "2.21.3"
# Shared by jersey-container-servlet, jersey-hk2, jersey-media-multipart,
jersey-media-json-jackson.
jersey = "3.1.11"
-# Shared by swagger-jaxrs2-core, swagger-jaxrs2-servlet-initializer,
swagger-annotations.
+# Shared by swagger-jaxrs2-core-jakarta,
swagger-jaxrs2-servlet-initializer-jakarta, swagger-annotations-jakarta.
swagger = "2.2.50"
oro = "2.0.8"
wsdl4j = "1.6.3"
@@ -181,9 +181,9 @@ jersey-container-servlet = { module =
"org.glassfish.jersey.containers:jersey-co
jersey-hk2 = { module = "org.glassfish.jersey.inject:jersey-hk2", version.ref
= "jersey" }
jersey-media-multipart = { module =
"org.glassfish.jersey.media:jersey-media-multipart", version.ref = "jersey" }
jersey-media-json-jackson = { module =
"org.glassfish.jersey.media:jersey-media-json-jackson", version.ref = "jersey" }
-swagger-jaxrs2-core = { module = "io.swagger.core.v3:swagger-jaxrs2",
version.ref = "swagger" }
-swagger-jaxrs2-servlet-initializer = { module =
"io.swagger.core.v3:swagger-jaxrs2-servlet-initializer", version.ref =
"swagger" }
-swagger-annotations = { module = "io.swagger.core.v3:swagger-annotations",
version.ref = "swagger" }
+swagger-jaxrs2-core = { module = "io.swagger.core.v3:swagger-jaxrs2-jakarta",
version.ref = "swagger" }
+swagger-jaxrs2-servlet-initializer = { module =
"io.swagger.core.v3:swagger-jaxrs2-servlet-initializer-jakarta", version.ref =
"swagger" }
+swagger-annotations = { module =
"io.swagger.core.v3:swagger-annotations-jakarta", version.ref = "swagger" }
oro = { module = "oro:oro", version.ref = "oro" }
wsdl4j = { module = "wsdl4j:wsdl4j", version.ref = "wsdl4j" }
java-jwt = { module = "com.auth0:java-jwt", version.ref = "java-jwt" }