You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2022/06/02 19:04:48 UTC

[GitHub] [camel] lburgazzoli opened a new pull request, #7715: CAMEL-14847: create a camel-jq component

lburgazzoli opened a new pull request, #7715:
URL: https://github.com/apache/camel/pull/7715

   <!-- Uncomment and fill this section if your PR is not trivial
   - [ ] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for the change (usually before you start working on it).  Trivial changes like typos do not require a JIRA issue.  Your pull request should address just this issue, without pulling in other changes.
   - [ ] Each commit in the pull request should have a meaningful subject line and body.
   - [ ] If you're unsure, you can format the pull request title like `[CAMEL-XXX] Fixes bug in camel-file component`, where you replace `CAMEL-XXX` with the appropriate JIRA issue.
   - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
   - [ ] Run `mvn clean install -Psourcecheck` in your module with source check enabled to make sure basic checks pass and there are no checkstyle violations. A more thorough check will be performed on your pull request automatically.
   Below are the contribution guidelines:
   https://github.com/apache/camel/blob/main/CONTRIBUTING.md
   -->
   


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] github-actions[bot] commented on pull request #7715: CAMEL-14847: create a camel-jq component

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #7715:
URL: https://github.com/apache/camel/pull/7715#issuecomment-1145278499

   :x: Finished component verification: **1 component(s) test failed** out of 2 component(s) tested


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] github-actions[bot] commented on pull request #7715: CAMEL-14847: create a camel-jq component

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #7715:
URL: https://github.com/apache/camel/pull/7715#issuecomment-1147737214

   :x: Finished component verification: **1 component(s) test failed** out of 2 component(s) tested


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] davsclaus commented on a diff in pull request #7715: CAMEL-14847: create a camel-jq component

Posted by GitBox <gi...@apache.org>.
davsclaus commented on code in PR #7715:
URL: https://github.com/apache/camel/pull/7715#discussion_r888614453


##########
components/camel-jq/src/main/java/org/apache/camel/language/jq/JqExpression.java:
##########
@@ -0,0 +1,244 @@
+package org.apache.camel.language.jq;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.Exchange;
+import org.apache.camel.RuntimeCamelException;
+import org.apache.camel.spi.ExpressionResultTypeAware;
+import org.apache.camel.support.CamelContextHelper;
+import org.apache.camel.support.ExpressionAdapter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.BooleanNode;
+
+import net.thisptr.jackson.jq.BuiltinFunctionLoader;
+import net.thisptr.jackson.jq.Function;
+import net.thisptr.jackson.jq.JsonQuery;
+import net.thisptr.jackson.jq.Scope;
+import net.thisptr.jackson.jq.Versions;
+import net.thisptr.jackson.jq.exception.JsonQueryException;
+
+public class JqExpression extends ExpressionAdapter implements ExpressionResultTypeAware {
+    private static final Logger LOGGER = LoggerFactory.getLogger(JqExpression.class);
+
+    private final String expression;
+    private final Scope scope;
+
+    private ObjectMapper objectMapper;
+    private String resultTypeName;
+    private Class<?> resultType;
+
+    private boolean autoDiscoverObjectMapper;

Review Comment:
   I wonder if you want/need for these fine grained auto discover functions to be able to turn them on|off individually?
   
   Would you for example turn off fromJq only? Or from serviceLoader only? And are these two built-in functions from JQ itself?



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] lburgazzoli commented on pull request #7715: CAMEL-14847: create a camel-jq component

Posted by GitBox <gi...@apache.org>.
lburgazzoli commented on PR #7715:
URL: https://github.com/apache/camel/pull/7715#issuecomment-1145215902

   @davsclaus @oscerd this is a first rough draft of a new language based on JQ (https://issues.apache.org/jira/browse/CAMEL-14847).
   
   As it's been a while since I created a language/component, I'm asking for advice on how to do it properly :) 


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] davsclaus commented on a diff in pull request #7715: CAMEL-14847: create a camel-jq component

Posted by GitBox <gi...@apache.org>.
davsclaus commented on code in PR #7715:
URL: https://github.com/apache/camel/pull/7715#discussion_r888615616


##########
core/camel-core-model/src/main/java/org/apache/camel/model/language/JqExpression.java:
##########
@@ -0,0 +1,115 @@
+/*
+ * 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.apache.camel.model.language;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
+
+import org.apache.camel.spi.Metadata;
+
+/**
+ * Evaluates a JQ expression.

Review Comment:
   Maybe do like jsonpath:
   
   Evaluates a JQ expression against a JSON message body.
   
   label = "language,json"



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] github-actions[bot] commented on pull request #7715: CAMEL-14847: create a camel-jq component

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #7715:
URL: https://github.com/apache/camel/pull/7715#issuecomment-1145871057

   :x: Finished component verification: **2 component(s) test failed** out of 7 component(s) tested


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] davsclaus commented on a diff in pull request #7715: CAMEL-14847: create a camel-jq component

Posted by GitBox <gi...@apache.org>.
davsclaus commented on code in PR #7715:
URL: https://github.com/apache/camel/pull/7715#discussion_r888613753


##########
components/camel-jq/src/generated/resources/META-INF/services/org/apache/camel/other.properties:
##########
@@ -0,0 +1,7 @@
+# Generated by camel build tools - do NOT edit this file!

Review Comment:
   I think the other.properties is wrong, maybe try to `rm -rf src/generated` to regen from fresh



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] davsclaus commented on a diff in pull request #7715: CAMEL-14847: create a camel-jq component

Posted by GitBox <gi...@apache.org>.
davsclaus commented on code in PR #7715:
URL: https://github.com/apache/camel/pull/7715#discussion_r888613570


##########
components/camel-jq/pom.xml:
##########
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    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.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.camel</groupId>
+        <artifactId>components</artifactId>
+        <version>3.18.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>camel-jq</artifactId>
+    <packaging>jar</packaging>
+    <name>Camel :: JQ</name>
+    <description>Java expression language using JQ</description>
+
+    <properties>
+        <firstVersion>3.18.0</firstVersion>
+        <sourcecheckExcludes>
+            **/MyRoutes*.java
+        </sourcecheckExcludes>
+        <sourcecheckExcludesComma>
+            ${sourcecheckExcludes},
+        </sourcecheckExcludesComma>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-support</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>net.thisptr</groupId>
+            <artifactId>jackson-jq</artifactId>

Review Comment:
   Add `version` here



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] davsclaus commented on a diff in pull request #7715: CAMEL-14847: create a camel-jq component

Posted by GitBox <gi...@apache.org>.
davsclaus commented on code in PR #7715:
URL: https://github.com/apache/camel/pull/7715#discussion_r888613275


##########
bom/camel-bom/pom.xml:
##########
@@ -1082,6 +1082,11 @@
         <artifactId>camel-jackson-avro</artifactId>
         <version>${project.version}</version>
       </dependency>
+      <dependency>
+        <groupId>org.apache.camel</groupId>
+        <artifactId>camel-jackson-jq</artifactId>

Review Comment:
   Maybe this is wrong as its called `camel-jq` in all the other places



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] github-actions[bot] commented on pull request #7715: CAMEL-14847: create a camel-jq component

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #7715:
URL: https://github.com/apache/camel/pull/7715#issuecomment-1145214294

   :warning: This PR changes Camel components and will be tested automatically.


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] github-actions[bot] commented on pull request #7715: CAMEL-14847: create a camel-jq component

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #7715:
URL: https://github.com/apache/camel/pull/7715#issuecomment-1145768443

   :x: Finished component verification: **1 component(s) test failed** out of 5 component(s) tested


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] lburgazzoli commented on pull request #7715: CAMEL-14847: create a camel-jq component

Posted by GitBox <gi...@apache.org>.
lburgazzoli commented on PR #7715:
URL: https://github.com/apache/camel/pull/7715#issuecomment-1145929699

   > 
   > You are welcome to create a JIRA about this
   
   https://issues.apache.org/jira/browse/CAMEL-18165
   
   


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] github-actions[bot] commented on pull request #7715: CAMEL-14847: create a camel-jq component

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #7715:
URL: https://github.com/apache/camel/pull/7715#issuecomment-1145775154

   :x: Finished component verification: **1 component(s) test failed** out of 5 component(s) tested


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] davsclaus commented on pull request #7715: CAMEL-14847: create a camel-jq component

Posted by GitBox <gi...@apache.org>.
davsclaus commented on PR #7715:
URL: https://github.com/apache/camel/pull/7715#issuecomment-1146564924

   Out of the box converters added


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] github-actions[bot] commented on pull request #7715: CAMEL-14847: create a camel-jq component

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #7715:
URL: https://github.com/apache/camel/pull/7715#issuecomment-1148262665

   :heavy_check_mark: Finished component verification: 0 component(s) test failed out of **2 component(s) tested**


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] github-actions[bot] commented on pull request #7715: CAMEL-14847: create a camel-jq component

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #7715:
URL: https://github.com/apache/camel/pull/7715#issuecomment-1147476238

   :x: Finished component verification: **1 component(s) test failed** out of 3 component(s) tested


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] github-actions[bot] commented on pull request #7715: CAMEL-14847: create a camel-jq component

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #7715:
URL: https://github.com/apache/camel/pull/7715#issuecomment-1145301898

   :x: Finished component verification: **1 component(s) test failed** out of 4 component(s) tested


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] davsclaus commented on a diff in pull request #7715: CAMEL-14847: create a camel-jq component

Posted by GitBox <gi...@apache.org>.
davsclaus commented on code in PR #7715:
URL: https://github.com/apache/camel/pull/7715#discussion_r888615011


##########
core/camel-core-model/src/main/java/org/apache/camel/model/language/JqExpression.java:
##########
@@ -0,0 +1,115 @@
+/*
+ * 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.apache.camel.model.language;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
+
+import org.apache.camel.spi.Metadata;
+
+/**
+ * Evaluates a JQ expression.
+ */
+@Metadata(firstVersion = "3.18.0", label = "language", title = "Jq")
+@XmlRootElement(name = "jq")
+@XmlAccessorType(XmlAccessType.FIELD)
+public class JqExpression extends ExpressionDefinition {
+    @XmlAttribute(name = "resultType")
+    private String resultTypeName;
+    @XmlTransient
+    private Class<?> resultType;
+
+    @XmlAttribute
+    @Metadata(label = "advanced", defaultValue = "true", javaType = "java.lang.Boolean")
+    private String autoDiscoverFunctionsFromServiceLoader;
+    @XmlAttribute
+    @Metadata(label = "advanced", defaultValue = "true", javaType = "java.lang.Boolean")
+    private String autoDiscoverFunctionsFromJq;
+    @XmlAttribute
+    @Metadata(label = "advanced", defaultValue = "true", javaType = "java.lang.Boolean")
+    private String autoDiscoverFunctionsFromRegistry;
+
+    public JqExpression() {
+    }
+
+    public JqExpression(String expression) {
+        super(expression);
+    }
+
+    @Override
+    public String getLanguage() {
+        return "jq";
+    }
+
+    public String getResultTypeName() {
+        return resultTypeName;
+    }
+
+    /**
+     * Sets the class of the result type (type from output)
+     */
+    public void setResultTypeName(String resultTypeName) {
+        this.resultTypeName = resultTypeName;
+    }
+
+    public Class<?> getResultType() {
+        return resultType;
+    }
+
+    /**
+     * Sets the class name of the result type (type from output)
+     */
+    public void setResultType(Class<?> resultType) {
+        this.resultType = resultType;
+    }
+
+    public String isAutoDiscoverFunctionsFromServiceLoader() {
+        return autoDiscoverFunctionsFromServiceLoader;
+    }
+
+    /**
+     * Set if JQ functions should be discovered using the {@link java.util.ServiceLoader} mechanism.
+     */
+    public void setAutoDiscoverFunctionsFromServiceLoader(String autoDiscoverFunctionsFromServiceLoader) {
+        this.autoDiscoverFunctionsFromServiceLoader = autoDiscoverFunctionsFromServiceLoader;
+    }
+
+    public String isAutoDiscoverFunctionsFromJq() {
+        return autoDiscoverFunctionsFromJq;
+    }
+
+    /**
+     * Set if JQ functions should be discovered from JQ's json file.

Review Comment:
   What does this mean? Maybe the doc page should have more details? For users that dont know JQ to well. Does it mean you can have built-in functions in a JQ script file?



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] davsclaus commented on pull request #7715: CAMEL-14847: create a camel-jq component

Posted by GitBox <gi...@apache.org>.
davsclaus commented on PR #7715:
URL: https://github.com/apache/camel/pull/7715#issuecomment-1145592052

   Great work you have not lost the knowledge how to build new languages.
   
   Also maybe add support for `headerName` that some languages have that makes it possible to supply the json in a header instead of message body. See JSonPath language


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] github-actions[bot] commented on pull request #7715: CAMEL-14847: create a camel-jq component

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #7715:
URL: https://github.com/apache/camel/pull/7715#issuecomment-1147536076

   :x: Finished component verification: **1 component(s) test failed** out of 3 component(s) tested


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] github-actions[bot] commented on pull request #7715: CAMEL-14847: create a camel-jq component

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #7715:
URL: https://github.com/apache/camel/pull/7715#issuecomment-1147804192

   :x: Finished component verification: **1 component(s) test failed** out of 2 component(s) tested


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] lburgazzoli commented on pull request #7715: CAMEL-14847: create a camel-jq component

Posted by GitBox <gi...@apache.org>.
lburgazzoli commented on PR #7715:
URL: https://github.com/apache/camel/pull/7715#issuecomment-1145717274

   @davsclaus I've fixed most of the findings (doc is still not up to date)
   
   One additional question I have is that in the camel-jackson component, the Jackson Type converter [must explicitly be enabled ](https://github.com/apache/camel/blob/main/components/camel-jackson/src/main/java/org/apache/camel/component/jackson/converter/JacksonTypeConverters.java#L72).
   
   I wonder if some basic conversion (i.e. InputStream/String/byte[]/Map <--> JsonNode) can be enabled by default.
   The reason for that is that the jq extension requires the input to be a JsonNode and of course I can do my own set if/else but maybe it would be better to leverage the type converter, WDYT ? as alternative the doc can mention that the JacksonTypeConverters shuld be explicitly enabled.
   
   
   
   


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] github-actions[bot] commented on pull request #7715: CAMEL-14847: create a camel-jq component

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #7715:
URL: https://github.com/apache/camel/pull/7715#issuecomment-1145803252

   :x: Finished component verification: **1 component(s) test failed** out of 5 component(s) tested


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] davsclaus commented on pull request #7715: CAMEL-14847: create a camel-jq component

Posted by GitBox <gi...@apache.org>.
davsclaus commented on PR #7715:
URL: https://github.com/apache/camel/pull/7715#issuecomment-1145878475

   Ah yeah the problem is that its a fallback type converter that is too generic.
   
   We can add explict type converters that uses `JSonObject` `JsonNode` or what there is that are 100% json then we can use regular type converters that are always enabled.
   
   And we can modify the fallback to be for special use-cases.
   
   You are welcome to create a JIRA about this


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] davsclaus commented on a diff in pull request #7715: CAMEL-14847: create a camel-jq component

Posted by GitBox <gi...@apache.org>.
davsclaus commented on code in PR #7715:
URL: https://github.com/apache/camel/pull/7715#discussion_r888615132


##########
core/camel-core-model/src/main/java/org/apache/camel/model/language/JqExpression.java:
##########
@@ -0,0 +1,115 @@
+/*
+ * 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.apache.camel.model.language;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
+
+import org.apache.camel.spi.Metadata;
+
+/**
+ * Evaluates a JQ expression.
+ */
+@Metadata(firstVersion = "3.18.0", label = "language", title = "Jq")

Review Comment:
   title = `JQ`



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] github-actions[bot] commented on pull request #7715: CAMEL-14847: create a camel-jq component

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #7715:
URL: https://github.com/apache/camel/pull/7715#issuecomment-1145965521

   :heavy_check_mark: Finished component verification: 0 component(s) test failed out of **7 component(s) tested**


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] lburgazzoli merged pull request #7715: CAMEL-14847: create a camel-jq component

Posted by GitBox <gi...@apache.org>.
lburgazzoli merged PR #7715:
URL: https://github.com/apache/camel/pull/7715


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] lburgazzoli commented on pull request #7715: CAMEL-14847: create a camel-jq component

Posted by GitBox <gi...@apache.org>.
lburgazzoli commented on PR #7715:
URL: https://github.com/apache/camel/pull/7715#issuecomment-1147415815

   @davsclaus @oscerd made some refactor to leverage type converters instead of custom object mapper and custom conversion logic 


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org