Fix operations{Json,Xml}GET definition 58/109058/4
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 24 Nov 2023 15:55:26 +0000 (16:55 +0100)
committerRobert Varga <nite@hq.sk>
Fri, 24 Nov 2023 18:02:11 +0000 (18:02 +0000)
AsyncResponse should be @Suspended, otherwise we get a warnings from
Jersey that "A HTTP GET method, ..., should not consume any entity."

JIRA: NETCONF-773
Change-Id: I6ad989ae7bd8cd6a0303945d2bf6040c6fea8a5b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/jaxrs/JaxRsRestconf.java

index 3ee648af7e11d1c49fab26e3829a69e22caba334..f7e3d50cd51c748ac8e2bf9b5faf87d8ef2dc2b0 100644 (file)
@@ -588,7 +588,8 @@ public final class JaxRsRestconf {
     @GET
     @Path("/operations/{operation:.+}")
     @Produces({ MediaTypes.APPLICATION_YANG_DATA_JSON, MediaType.APPLICATION_JSON })
-    public void operationsJsonGET(@PathParam("operation") final JaxRsApiPath operation, final AsyncResponse ar) {
+    public void operationsJsonGET(@PathParam("operation") final JaxRsApiPath operation,
+            @Suspended final AsyncResponse ar) {
         completeOperationsGet(server.operationsGET(operation.apiPath), ar, OperationsGetResult::toJSON);
     }
 
@@ -618,7 +619,8 @@ public final class JaxRsRestconf {
     @GET
     @Path("/operations/{operation:.+}")
     @Produces({ MediaTypes.APPLICATION_YANG_DATA_XML, MediaType.APPLICATION_XML, MediaType.TEXT_XML })
-    public void operationsXmlGET(@PathParam("operation") final JaxRsApiPath operation, final AsyncResponse ar) {
+    public void operationsXmlGET(@PathParam("operation") final JaxRsApiPath operation,
+            @Suspended final AsyncResponse ar) {
         completeOperationsXmlGet(server.operationsGET(operation.apiPath), ar);
     }