oEscal commented on code in PR #3927:
URL: 
https://github.com/apache/incubator-kie-kogito-runtimes/pull/3927#discussion_r2163945756


##########
quarkus/addons/knative/serving/runtime/src/main/java/org/kie/kogito/addons/quarkus/knative/serving/customfunctions/GetParamsDecorator.java:
##########
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.kie.kogito.addons.quarkus.knative.serving.customfunctions;
+
+import java.util.Map;
+
+import org.kie.kogito.internal.process.workitem.KogitoWorkItem;
+import org.kogito.workitem.rest.decorators.PrefixParamsDecorator;
+
+import io.vertx.mutiny.ext.web.client.HttpRequest;
+
+public final class GetParamsDecorator extends PrefixParamsDecorator {
+
+    private Map<String, Object> getParams;
+
+    @Override
+    public void decorate(KogitoWorkItem item, Map<String, Object> parameters, 
HttpRequest<?> request) {
+        this.getParams = KnativeFunctionPayloadSupplier.getPayload(parameters);
+        super.decorate(item, parameters, request);
+    }
+
+    @Override
+    protected boolean isQueryParameter(String key) {
+        return this.getParams.containsKey(key) && 
!super.isHeaderParameter(key);

Review Comment:
   I did it like this because if I use the `super.isQueryParameter`, parameters 
not in the format `QUERY_<parameter>` will not be recognized. With this code, I 
accept both `QUERY_<parameter>` and `<parameter>` formats for query parameters.
   There is only one pending issue, I think. As I mentioned in a [previous 
comment](https://github.com/apache/incubator-kie-kogito-runtimes/pull/3927#issuecomment-2917020361),
 we need to decide if `QUERY_<parameter>` will be accepted as is or as 
`parameter`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to