// Do not edit directly!
// This file was generated by camel-quarkus-maven-plugin:update-extension-doc-page
[id="extensions-jq"]
= JQ
:linkattrs:
:cq-artifact-id: camel-quarkus-jq
:cq-native-supported: true
:cq-status: Stable
:cq-status-deprecation: Stable
:cq-description: Evaluates a JQ expression against a JSON message body.
:cq-deprecated: false
:cq-jvm-since: 2.11.0
:cq-native-since: 2.11.0

ifeval::[{doc-show-badges} == true]
[.badges]
[.badge-key]##JVM since##[.badge-supported]##2.11.0## [.badge-key]##Native since##[.badge-supported]##2.11.0##
endif::[]

Evaluates a JQ expression against a JSON message body.

[id="extensions-jq-whats-inside"]
== What's inside

* xref:{cq-camel-components}:languages:jq-language.adoc[JQ language]

Please refer to the above link for usage and configuration details.

[id="extensions-jq-maven-coordinates"]
== Maven coordinates

https://{link-quarkus-code-generator}/?extension-search=camel-quarkus-jq[Create a new project with this extension on {link-quarkus-code-generator}, window="_blank"]

Or add the coordinates to your existing project:

[source,xml]
----
<dependency>
    <groupId>org.apache.camel.quarkus</groupId>
    <artifactId>camel-quarkus-jq</artifactId>
</dependency>
----
ifeval::[{doc-show-user-guide-link} == true]
Check the xref:user-guide/index.adoc[User guide] for more information about writing Camel Quarkus applications.
endif::[]

[id="extensions-jq-usage"]
== Usage
[id="extensions-jq-usage-jq-transformations-to-custom-result-types-in-native-mode"]
=== JQ transformations to custom result types in native mode

If you choose to perform JQ transformations that specify the result class as some custom type in native mode,
then you must register that type for reflection.

E.g via the `@RegisterForReflection`
annotation or configuration property `quarkus.camel.native.reflection.include-patterns`. For example:

[source,java]
----
@RegisterForReflection
public class Book {
    ...
}
----

[source,java]
----
public class MyJQRoutes extends RouteBuilder {
    @Override
    public void configure() {
        from("direct:jq")
            .transform().jq(".book", Book.class);
    }
}
----

Refer to the xref:user-guide/native-mode.adoc#reflection[Native mode] user guide for more information.

