Skip to content

CAMEL-25900: camel-jbang - AI tools: lead to the jsonpath filter with resultType java.util.Map for the one element of a list - #28210

Merged
davsclaus merged 1 commit into
mainfrom
fix/CAMEL-25900
Oct 21, 2026
Merged

davsclaus merged 1 commit into
mainfrom
fix/CAMEL-25900

Conversation

@davsclaus

Copy link
Copy Markdown
Contributor

https://issues.apache.org/jira/browse/CAMEL-25900

The REST example of the benchmark (one order out of a JSON list by its id, 404 when unknown) failed 12 of 12 times on two nights. The model saw the earlier hints but wrote paths that give the wrong answer:

  • $[?(@.orderId == '${header.id}')][0] gives an empty list. Jayway applies an index after a filter to each element it matched.
  • $[?(…)] && size() > 0 is no JsonPath, and fails with 500.
  • ${body[0].orderId} takes the first element, because the List hint offered [0] first.

The recipe is a filter with resultType: java.util.Map: the element when one matches, null when none does. The tools now lead to it:

  • Source check (JsonPathChecks): it reports an index after a filter, and && or || outside a filter, and names the recipe.
  • camel_eval_expression: for a jsonpath filter, the answer notes that a filter gives a list also for one match, and that a route gets the one element with resultType: java.util.Map.
  • camel_catalog_doc jsonpath: it answers the recipe in usage.
  • camel-bean: the hint for ${body.orderId} on a List leads with the jsonpath recipe, and [0] comes after it.
  • camel_catalog_find CamelHttpStatusCode (and similar names): it names CamelHttpResponseCode (Exchange.HTTP_RESPONSE_CODE).

I did not add a resultType parameter to camel_eval_expression. With two new parameters, the prompt of the AI clients grew by about 60 tokens, past its budget with all tool groups loaded. The note in the answer teaches the same recipe at no prompt cost.

Tests: new tests in JsonPathChecksTest (3), CatalogDocsTest (2), ExpressionEvaluatorLanguageTest (1), and an updated SimpleSyntaxHintsTest. camel-jbang-core 2406 + 237, camel-jbang-mcp 503 and the camel-core simple hint tests (33) pass, and the prompt budget is unchanged.

Claude Code on behalf of davsclaus

🤖 Generated with Claude Code

https://claude.ai/code/session_01STT6whBgK1AqsSsUKrnE8m

@davsclaus davsclaus added this to the 4.24.0 milestone Oct 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • components/camel-bean
  • core/camel-core
  • dsl/camel-jbang/camel-jbang-core

ℹ️ Dependent modules were not tested because the total number of affected modules exceeded the threshold (50). Use the test-dependents label to force testing all dependents.

🔁 4 tests passed only after a retry on JDK 21 (4 retried attempts)

Recovered flaky tests on JDK 21 (4)
Module Test Failed attempts First failure
core/camel-core FileConsumerIncludeNameTest.testIncludePreAndPostfixes 1 mock://result Message with body Reports2 was expected but not found in [, Reports3]
core/camel-core DistributedOptimisticLockFailingTest.testEverySecondOneFails 1 expected: <25> but was: <11>
core/camel-core PollEnrichTimeoutFileBodyTest.theVariableIsNullWhenNothingWasPolled 1 Error during type conversion from type: java.lang.String to the required type: java.lang.String due to org.apache.camel.TypeConversionException: Error during type conversion from type: java.io.File to the required type: byte[] due to java.nio.file.NoSuchFileException: /tmp/junit-4712595141642405203/orders-variable/order-1001.json
core/camel-core TotalRequestsThrottlerRateDecreaseTest.testDecreaseWhileExchangesWaitForPermits 1 Condition with Lambda expression in org.apache.camel.processor.throttle.requests.TotalRequestsThrottlerRateDecreaseTest was not fulfilled within 5 seconds.

ℹ️ These tests did not fail the build. Surefire retried them and they passed.
Retries are enabled project-wide by surefire.rerunFailingTestsCount in parent/pom.xml.


🔬 Scalpel shadow comparison — Scalpel: 490 of 707 tested, 26 compile-only — current: 492 all tested

Maveniverse Scalpel detected 490 affected modules (current approach: 492).

Skip-tests mode would test 490 modules (3 direct + 488 downstream), skip tests for 26 (generated code, meta-modules)

Modules only in current approach (2)
  • camel-google-common
  • camel-test-infra-core
Modules Scalpel would test (490)
  • archetypes ← downstream of org.apache.camel:camel-test-junit6
  • camel-a2a ← downstream of org.apache.camel:camel-test-junit6
  • camel-activemq ← downstream of org.apache.camel:camel-jms
  • camel-activemq6 ← downstream of org.apache.camel:camel-jms
  • camel-ai-observability ← downstream of org.apache.camel:camel-test-junit6
  • camel-ai-observability-api ← downstream of org.apache.camel:camel-test-junit6
  • camel-ai-resource ← downstream of org.apache.camel:camel-test-junit6
  • camel-ai-tool ← downstream of org.apache.camel:camel-test-junit6
  • camel-alibaba-eventbridge ← downstream of org.apache.camel:camel-test-junit6
  • camel-alibaba-fc ← downstream of org.apache.camel:camel-test-junit6
  • camel-alibaba-kms ← downstream of org.apache.camel:camel-test-junit6
  • camel-alibaba-mns ← downstream of org.apache.camel:camel-test-junit6
  • camel-alibaba-oss ← downstream of org.apache.camel:camel-test-junit6
  • camel-alibaba-ots ← downstream of org.apache.camel:camel-test-junit6
  • camel-alibaba-sls ← downstream of org.apache.camel:camel-test-junit6
  • camel-alibaba-sms ← downstream of org.apache.camel:camel-test-junit6
  • camel-amqp ← downstream of org.apache.camel:camel-test-junit6
  • camel-api-component-maven-plugin ← downstream of org.apache.camel:camel-test-junit6
  • camel-arangodb ← downstream of org.apache.camel:camel-test-junit6
  • camel-archetype-api-component ← downstream of org.apache.camel:camel-test-junit6
  • camel-archetype-component ← downstream of org.apache.camel:camel-test-junit6
  • camel-archetype-dataformat ← downstream of org.apache.camel:camel-test-junit6
  • camel-archetype-java ← downstream of org.apache.camel:camel-test-junit6
  • camel-archetype-main ← downstream of org.apache.camel:camel-test-junit6
  • camel-as2 ← downstream of org.apache.camel:camel-test-junit6
  • camel-as2-api ← downstream of org.apache.camel:camel-test-junit6
  • camel-asn1 ← downstream of org.apache.camel:camel-test-junit6
  • camel-asterisk ← downstream of org.apache.camel:camel-test-junit6
  • camel-atmosphere-websocket ← downstream of org.apache.camel:camel-test-junit6
  • camel-atom ← downstream of org.apache.camel:camel-test-junit6
  • camel-attachments ← downstream of org.apache.camel:camel-bean
  • camel-avro ← downstream of org.apache.camel:camel-test-junit6
  • camel-avro-rpc ← downstream of org.apache.camel:camel-test-junit6
  • camel-aws-bedrock ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-aws-cloudtrail ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-aws-config ← downstream of org.apache.camel:camel-test-junit6
  • camel-aws-parameter-store ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-aws-secrets-manager ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-aws-security-hub ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-aws2-athena ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-aws2-comprehend ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-aws2-cw ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-aws2-ddb ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-aws2-ec2 ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-aws2-ecs ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-aws2-eks ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-aws2-eventbridge ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-aws2-iam ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-aws2-kinesis ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-aws2-kms ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-aws2-lambda ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-aws2-mq ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-aws2-msk ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-aws2-polly ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-aws2-redshift ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-aws2-rekognition ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-aws2-s3 ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-aws2-s3-vectors ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-aws2-ses ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-aws2-sns ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-aws2-sqs ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-aws2-step-functions ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-aws2-sts ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-aws2-textract ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-aws2-timestream ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-aws2-transcribe ← downstream of org.apache.camel:camel-test-junit6
  • camel-aws2-translate ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-azure-cosmosdb ← downstream of org.apache.camel:camel-test-junit6
  • camel-azure-eventgrid ← downstream of org.apache.camel:camel-test-junit6
  • camel-azure-eventhubs ← downstream of org.apache.camel:camel-test-junit6
  • camel-azure-files ← downstream of org.apache.camel:camel-test-junit6
  • camel-azure-functions ← downstream of org.apache.camel:camel-test-junit6
  • camel-azure-key-vault ← downstream of org.apache.camel:camel-test-junit6
  • camel-azure-schema-registry ← downstream of org.apache.camel:camel-test-junit6
  • camel-azure-servicebus ← downstream of org.apache.camel:camel-test-junit6
  • camel-azure-storage-blob ← downstream of org.apache.camel:camel-test-junit6
  • camel-azure-storage-datalake ← downstream of org.apache.camel:camel-test-junit6
  • camel-azure-storage-queue ← downstream of org.apache.camel:camel-test-junit6
  • camel-barcode ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-base64 ← downstream of org.apache.camel:camel-test-junit6
  • camel-bean ← components/camel-bean/src/main/java/org/apache/camel/language/bean/BeanExpression.java
  • camel-bean-validator ← downstream of org.apache.camel:camel-test-junit6
  • camel-beanio ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-bindy ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-bonita ← downstream of org.apache.camel:camel-test-junit6
  • camel-box ← downstream of org.apache.camel:camel-test-junit6
  • camel-braintree ← downstream of org.apache.camel:camel-test-junit6
  • camel-caffeine ← downstream of org.apache.camel:camel-test-junit6
  • camel-camunda ← downstream of org.apache.camel:camel-test-junit6
  • camel-cassandraql ← downstream of org.apache.camel:camel-test-junit6
  • camel-cbor ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-chatscript ← downstream of org.apache.camel:camel-test-junit6
  • camel-chunk ← downstream of org.apache.camel:camel-test-junit6
  • camel-cli-connector ← downstream of org.apache.camel:camel-management
  • camel-cli-debug ← downstream of org.apache.camel:camel-cli-connector
  • camel-clickhouse ← downstream of org.apache.camel:camel-test-junit6
  • camel-clickup ← downstream of org.apache.camel:camel-test-junit6
  • camel-cloudevents ← downstream of org.apache.camel:camel-test-junit6
  • camel-cm-sms ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-coap ← downstream of org.apache.camel:camel-test-junit6
  • camel-cometd ← downstream of org.apache.camel:camel-test-junit6
  • camel-console ← downstream of org.apache.camel:camel-management
  • camel-consul ← downstream of org.apache.camel:camel-bean
  • camel-core ← core/camel-core/src/test/java/org/apache/camel/language/simple/SimpleSyntaxHintsTest.java
  • camel-core-all ← downstream of org.apache.camel:camel-management
  • camel-couchbase ← downstream of org.apache.camel:camel-test-junit6
  • camel-couchdb ← downstream of org.apache.camel:camel-test-junit6
  • camel-cron ← downstream of org.apache.camel:camel-test-junit6
  • camel-crypto ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-crypto-pgp ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-csv ← downstream of org.apache.camel:camel-main
  • camel-cxf-common ← downstream of org.apache.camel:camel-test-junit6
  • camel-cxf-rest ← downstream of org.apache.camel:camel-test-junit6
  • camel-cxf-soap ← downstream of org.apache.camel:camel-test-junit6
  • camel-cxf-spring-common ← downstream of org.apache.camel:camel-spring-xml
  • camel-cxf-spring-rest ← downstream of org.apache.camel:camel-spring-xml
  • camel-cxf-spring-soap ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-cxf-spring-transport ← downstream of org.apache.camel:camel-test-junit6
  • camel-cxf-transport ← downstream of org.apache.camel:camel-test-junit6
  • camel-cyberark-vault ← downstream of org.apache.camel:camel-test-junit6
  • camel-dapr ← downstream of org.apache.camel:camel-test-junit6
  • camel-datasonnet ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-debezium-common ← downstream of org.apache.camel:camel-test-junit6
  • camel-debezium-db2 ← downstream of org.apache.camel:camel-test-junit6
  • camel-debezium-maven-plugin ← downstream of org.apache.camel:camel-test-junit6
  • camel-debezium-mongodb ← downstream of org.apache.camel:camel-test-junit6
  • camel-debezium-mysql ← downstream of org.apache.camel:camel-test-junit6
  • camel-debezium-oracle ← downstream of org.apache.camel:camel-test-junit6
  • camel-debezium-postgres ← downstream of org.apache.camel:camel-test-junit6
  • camel-debezium-sqlserver ← downstream of org.apache.camel:camel-test-junit6
  • camel-debug ← downstream of org.apache.camel:camel-management
  • camel-dfdl ← downstream of org.apache.camel:camel-test-junit6
  • camel-dhis2 ← downstream of org.apache.camel:camel-test-junit6
  • camel-dhis2-api ← downstream of org.apache.camel:camel-test-junit6
  • camel-dhis2-parent ← downstream of org.apache.camel:camel-test-junit6
  • camel-diagram ← downstream of org.apache.camel:camel-management
  • camel-disruptor ← downstream of org.apache.camel:camel-test-junit6
  • camel-djl ← downstream of org.apache.camel:camel-test-junit6
  • camel-dns ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-docker ← downstream of org.apache.camel:camel-test-junit6
  • camel-docling ← downstream of org.apache.camel:camel-test-junit6
  • camel-drill ← downstream of org.apache.camel:camel-test-junit6
  • camel-dropbox ← downstream of org.apache.camel:camel-test-junit6
  • camel-dsl-modeline ← downstream of org.apache.camel:camel-test-junit6
  • camel-duckdb ← downstream of org.apache.camel:camel-test-junit6
  • camel-dynamic-router ← downstream of org.apache.camel:camel-management
  • camel-ehcache ← downstream of org.apache.camel:camel-test-junit6
  • camel-elasticsearch ← downstream of org.apache.camel:camel-test-junit6
  • camel-elasticsearch-rest-client ← downstream of org.apache.camel:camel-test-junit6
  • camel-event ← downstream of org.apache.camel:camel-test-junit6
  • camel-exec ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-fastjson ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-fhir ← downstream of org.apache.camel:camel-test-junit6
  • camel-file-watch ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-flatpack ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-flink ← downstream of org.apache.camel:camel-test-junit6
  • camel-flowable ← downstream of org.apache.camel:camel-test-junit6
  • camel-fop ← downstream of org.apache.camel:camel-test-junit6
  • camel-fory ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-freemarker ← downstream of org.apache.camel:camel-management
  • camel-ftp ← downstream of org.apache.camel:camel-test-junit6
  • camel-geocoder ← downstream of org.apache.camel:camel-test-junit6
  • camel-git ← downstream of org.apache.camel:camel-test-junit6
  • camel-github2 ← downstream of org.apache.camel:camel-test-junit6
  • camel-google-bigquery ← downstream of org.apache.camel:camel-test-junit6
  • camel-google-calendar ← downstream of org.apache.camel:camel-test-junit6
  • camel-google-drive ← downstream of org.apache.camel:camel-test-junit6
  • camel-google-firestore ← downstream of org.apache.camel:camel-test-junit6
  • camel-google-functions ← downstream of org.apache.camel:camel-test-junit6
  • camel-google-mail ← downstream of org.apache.camel:camel-test-junit6
  • camel-google-pubsub ← downstream of org.apache.camel:camel-test-junit6
  • camel-google-secret-manager ← downstream of org.apache.camel:camel-test-junit6
  • camel-google-sheets ← downstream of org.apache.camel:camel-test-junit6
  • camel-google-speech-to-text ← downstream of org.apache.camel:camel-test-junit6
  • camel-google-storage ← downstream of org.apache.camel:camel-test-junit6
  • camel-google-text-to-speech ← downstream of org.apache.camel:camel-test-junit6
  • camel-google-vertexai ← downstream of org.apache.camel:camel-test-junit6
  • camel-google-vision ← downstream of org.apache.camel:camel-test-junit6
  • camel-graphql ← downstream of org.apache.camel:camel-test-junit6
  • camel-grok ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-groovy ← downstream of org.apache.camel:camel-main
  • camel-grpc ← downstream of org.apache.camel:camel-test-junit6
  • camel-gson ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-hashicorp-vault ← downstream of org.apache.camel:camel-test-junit6
  • camel-hazelcast ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-hivemq ← downstream of org.apache.camel:camel-test-junit6
  • camel-hl7 ← downstream of org.apache.camel:camel-test-junit6
  • camel-http ← downstream of org.apache.camel:camel-management
  • camel-http-base ← downstream of org.apache.camel:camel-test-junit6
  • camel-http-common ← downstream of org.apache.camel:camel-test-junit6
  • camel-huaweicloud-dms ← downstream of org.apache.camel:camel-test-junit6
  • camel-huaweicloud-frs ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-huaweicloud-functiongraph ← downstream of org.apache.camel:camel-test-junit6
  • camel-huaweicloud-iam ← downstream of org.apache.camel:camel-test-junit6
  • camel-huaweicloud-imagerecognition ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-huaweicloud-obs ← downstream of org.apache.camel:camel-test-junit6
  • camel-huaweicloud-smn ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-huggingface ← downstream of org.apache.camel:camel-test-junit6
  • camel-ibm-cos ← downstream of org.apache.camel:camel-test-junit6
  • camel-ibm-secrets-manager ← downstream of org.apache.camel:camel-test-junit6
  • camel-ibm-watson-discovery ← downstream of org.apache.camel:camel-test-junit6
  • camel-ibm-watson-language ← downstream of org.apache.camel:camel-test-junit6
  • camel-ibm-watson-speech-to-text ← downstream of org.apache.camel:camel-test-junit6
  • camel-ibm-watson-text-to-speech ← downstream of org.apache.camel:camel-test-junit6
  • camel-ibm-watsonx-ai ← downstream of org.apache.camel:camel-test-junit6
  • camel-ibm-watsonx-data ← downstream of org.apache.camel:camel-test-junit6
  • camel-ical ← downstream of org.apache.camel:camel-test-junit6
  • camel-iggy ← downstream of org.apache.camel:camel-test-junit6
  • camel-ignite ← downstream of org.apache.camel:camel-test-junit6
  • camel-infinispan ← downstream of org.apache.camel:camel-test-junit6
  • camel-infinispan-common ← downstream of org.apache.camel:camel-test-junit6
  • camel-infinispan-embedded ← downstream of org.apache.camel:camel-test-junit6
  • camel-influxdb ← downstream of org.apache.camel:camel-test-junit6
  • camel-influxdb2 ← downstream of org.apache.camel:camel-test-junit6
  • camel-iso8583 ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-jackson ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-jackson-avro ← downstream of org.apache.camel:camel-test-junit6
  • camel-jackson-protobuf ← downstream of org.apache.camel:camel-test-junit6
  • camel-jackson3 ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-jackson3-avro ← downstream of org.apache.camel:camel-test-junit6
  • camel-jackson3-protobuf ← downstream of org.apache.camel:camel-test-junit6
  • camel-jackson3xml ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-jacksonxml ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-jactl ← downstream of org.apache.camel:camel-test-junit6
  • camel-jandex ← downstream of org.apache.camel:camel-test-junit6
  • camel-jasypt ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-java-joor-dsl ← downstream of org.apache.camel:camel-bean
  • camel-javascript ← downstream of org.apache.camel:camel-test-junit6
  • camel-jaxb ← downstream of org.apache.camel:camel-test-junit6
  • camel-jbang-console ← downstream of org.apache.camel:camel-management
  • camel-jbang-mcp ← downstream of org.apache.camel:camel-jbang-core
  • camel-jbang-plugin-mcp ← downstream of org.apache.camel:camel-jbang-core
  • camel-jbang-plugin-tui ← downstream of org.apache.camel:camel-jbang-core
  • camel-jbang-plugin-validate ← downstream of org.apache.camel:camel-jbang-core
  • camel-jcache ← downstream of org.apache.camel:camel-test-junit6
  • camel-jcr ← downstream of org.apache.camel:camel-test-junit6
  • camel-jdbc ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-jetty ← downstream of org.apache.camel:camel-management
  • camel-jetty-common ← downstream of org.apache.camel:camel-spring-xml
  • camel-jfr ← downstream of org.apache.camel:camel-test-junit6
  • camel-jgroups ← downstream of org.apache.camel:camel-test-junit6
  • camel-jgroups-raft ← downstream of org.apache.camel:camel-test-junit6
  • camel-jira ← downstream of org.apache.camel:camel-test-junit6
  • camel-jms ← downstream of org.apache.camel:camel-management
  • camel-jmx ← downstream of org.apache.camel:camel-management
  • camel-jolt ← downstream of org.apache.camel:camel-test-junit6
  • camel-jooq ← downstream of org.apache.camel:camel-test-junit6
  • camel-joor ← downstream of org.apache.camel:camel-test-junit6
  • camel-jpa ← downstream of org.apache.camel:camel-test-junit6
  • camel-jq ← downstream of org.apache.camel:camel-test-junit6
  • camel-jsch ← downstream of org.apache.camel:camel-test-junit6
  • camel-jslt ← downstream of org.apache.camel:camel-test-junit6
  • camel-json-validator ← downstream of org.apache.camel:camel-test-junit6
  • camel-jsonapi ← downstream of org.apache.camel:camel-test-junit6
  • camel-jsonata ← downstream of org.apache.camel:camel-test-junit6
  • camel-jsonb ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-jsonpath ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-jsoup ← downstream of org.apache.camel:camel-test-junit6
  • camel-jt400 ← downstream of org.apache.camel:camel-test-junit6
  • camel-jta ← downstream of org.apache.camel:camel-sql
  • camel-jte ← downstream of org.apache.camel:camel-test-junit6
  • camel-kafka ← downstream of org.apache.camel:camel-test-junit6
  • camel-kafka-common ← downstream of org.apache.camel:camel-test-junit6
  • camel-kafka-share ← downstream of org.apache.camel:camel-test-junit6
  • camel-kamelet ← downstream of org.apache.camel:camel-management
  • camel-kamelet-main-support ← downstream of org.apache.camel:camel-main
  • camel-keycloak ← downstream of org.apache.camel:camel-test-junit6
  • camel-knative ← downstream of org.apache.camel:camel-test-junit6
  • camel-knative-api ← downstream of org.apache.camel:camel-test-junit6
  • camel-knative-http ← downstream of org.apache.camel:camel-test-junit6
  • camel-kserve ← downstream of org.apache.camel:camel-test-junit6
  • camel-kubernetes ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-kudu ← downstream of org.apache.camel:camel-test-junit6
  • camel-langchain4j-agent ← downstream of org.apache.camel:camel-test-junit6
  • camel-langchain4j-chat ← downstream of org.apache.camel:camel-test-junit6
  • camel-langchain4j-core ← downstream of org.apache.camel:camel-test-junit6
  • camel-langchain4j-embeddings ← downstream of org.apache.camel:camel-test-junit6
  • camel-langchain4j-embeddingstore ← downstream of org.apache.camel:camel-test-junit6
  • camel-langchain4j-ingest ← downstream of org.apache.camel:camel-test-junit6
  • camel-langchain4j-tokenizer ← downstream of org.apache.camel:camel-test-junit6
  • camel-langchain4j-web-search ← downstream of org.apache.camel:camel-test-junit6
  • camel-launcher-container ← downstream of org.apache.camel:camel-launcher
  • camel-ldap ← downstream of org.apache.camel:camel-test-junit6
  • camel-ldif ← downstream of org.apache.camel:camel-test-junit6
  • camel-lra ← downstream of org.apache.camel:camel-test-junit6
  • camel-lucene ← downstream of org.apache.camel:camel-test-junit6
  • camel-lumberjack ← downstream of org.apache.camel:camel-test-junit6
  • camel-lzf ← downstream of org.apache.camel:camel-test-junit6
  • camel-mail ← downstream of org.apache.camel:camel-attachments
  • camel-mail-microsoft-oauth ← downstream of org.apache.camel:camel-mail
  • camel-main ← downstream of org.apache.camel:camel-bean
  • camel-management ← downstream of org.apache.camel:camel-bean
  • camel-mapstruct ← downstream of org.apache.camel:camel-test-junit6
  • camel-master ← downstream of org.apache.camel:camel-test-junit6
  • camel-maven-plugin ← downstream of org.apache.camel:camel-spring-main
  • camel-mcp-server ← downstream of org.apache.camel:camel-test-junit6
  • camel-mcp-server-api ← downstream of org.apache.camel:camel-test-junit6
  • camel-mdc ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-metrics ← downstream of org.apache.camel:camel-management
  • camel-micrometer ← downstream of org.apache.camel:camel-management
  • camel-micrometer-observability ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-micrometer-prometheus ← downstream of org.apache.camel:camel-micrometer
  • camel-microprofile-config ← downstream of org.apache.camel:camel-test-junit6
  • camel-microprofile-fault-tolerance ← downstream of org.apache.camel:camel-management
  • camel-microprofile-health ← downstream of org.apache.camel:camel-test-junit6
  • camel-milo ← downstream of org.apache.camel:camel-test-junit6
  • camel-milvus ← downstream of org.apache.camel:camel-test-junit6
  • camel-mina ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-mina-sftp ← downstream of org.apache.camel:camel-test-junit6
  • camel-minio ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-mllp ← downstream of org.apache.camel:camel-test-junit6
  • camel-mongodb ← downstream of org.apache.camel:camel-test-junit6
  • camel-mongodb-gridfs ← downstream of org.apache.camel:camel-test-junit6
  • camel-mustache ← downstream of org.apache.camel:camel-test-junit6
  • camel-mvel ← downstream of org.apache.camel:camel-test-junit6
  • camel-mybatis ← downstream of org.apache.camel:camel-bean
  • camel-nats ← downstream of org.apache.camel:camel-test-junit6
  • camel-neo4j ← downstream of org.apache.camel:camel-test-junit6
  • camel-netty ← downstream of org.apache.camel:camel-management
  • camel-netty-http ← downstream of org.apache.camel:camel-management
  • camel-oaipmh ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-oauth ← downstream of org.apache.camel:camel-test-junit6
  • camel-observability-services ← downstream of org.apache.camel:camel-management
  • camel-observation ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-ocsf ← downstream of org.apache.camel:camel-test-junit6
  • camel-odata ← downstream of org.apache.camel:camel-test-junit6
  • camel-ognl ← downstream of org.apache.camel:camel-test-junit6
  • camel-olingo2 ← downstream of org.apache.camel:camel-test-junit6
  • camel-olingo2-api ← downstream of org.apache.camel:camel-test-junit6
  • camel-olingo4 ← downstream of org.apache.camel:camel-test-junit6
  • camel-olingo4-api ← downstream of org.apache.camel:camel-test-junit6
  • camel-once ← downstream of org.apache.camel:camel-test-junit6
  • camel-opa ← downstream of org.apache.camel:camel-test-junit6
  • camel-openai ← downstream of org.apache.camel:camel-test-junit6
  • camel-openapi-java ← downstream of org.apache.camel:camel-management
  • camel-openapi-validator ← downstream of org.apache.camel:camel-test-junit6
  • camel-openfeature ← downstream of org.apache.camel:camel-test-junit6
  • camel-openfga ← downstream of org.apache.camel:camel-test-junit6
  • camel-opensearch ← downstream of org.apache.camel:camel-test-junit6
  • camel-openstack ← downstream of org.apache.camel:camel-test-junit6
  • camel-opentelemetry ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-opentelemetry-metrics ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-opentelemetry2 ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-optaplanner ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-paho ← downstream of org.apache.camel:camel-test-junit6
  • camel-paho-mqtt5 ← downstream of org.apache.camel:camel-test-junit6
  • camel-parquet-avro ← downstream of org.apache.camel:camel-test-junit6
  • camel-pdf ← downstream of org.apache.camel:camel-test-junit6
  • camel-pg-replication-slot ← downstream of org.apache.camel:camel-test-junit6
  • camel-pgevent ← downstream of org.apache.camel:camel-test-junit6
  • camel-pgvector ← downstream of org.apache.camel:camel-test-junit6
  • camel-pinecone ← downstream of org.apache.camel:camel-test-junit6
  • camel-platform-http ← downstream of org.apache.camel:camel-test-junit6
  • camel-platform-http-jolokia ← downstream of org.apache.camel:camel-platform-http
  • camel-platform-http-main ← downstream of org.apache.camel:camel-test-junit6
  • camel-platform-http-vertx ← downstream of org.apache.camel:camel-management
  • camel-plc4x ← downstream of org.apache.camel:camel-test-junit6
  • camel-pqc ← downstream of org.apache.camel:camel-test-junit6
  • camel-printer ← downstream of org.apache.camel:camel-test-junit6
  • camel-protobuf ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-pubnub ← downstream of org.apache.camel:camel-test-junit6
  • camel-pulsar ← downstream of org.apache.camel:camel-test-junit6
  • camel-python ← downstream of org.apache.camel:camel-test-junit6
  • camel-python3 ← downstream of org.apache.camel:camel-test-junit6
  • camel-qdrant ← downstream of org.apache.camel:camel-test-junit6
  • camel-quartz ← downstream of org.apache.camel:camel-management
  • camel-quickfix ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-quickjs ← downstream of org.apache.camel:camel-test-junit6
  • camel-reactive-streams ← downstream of org.apache.camel:camel-management
  • camel-reactor ← downstream of org.apache.camel:camel-test-junit6
  • camel-redis ← downstream of org.apache.camel:camel-test-junit6
  • camel-resilience4j ← downstream of org.apache.camel:camel-management
  • camel-resilience4j-micrometer ← downstream of org.apache.camel:camel-management
  • camel-resourceresolver-github ← downstream of org.apache.camel:camel-test-junit6
  • camel-rest-openapi ← downstream of org.apache.camel:camel-test-junit6
  • camel-rest-postman ← downstream of org.apache.camel:camel-test-junit6
  • camel-restdsl-openapi-plugin ← downstream of org.apache.camel:camel-openapi-java
  • camel-robotframework ← downstream of org.apache.camel:camel-test-junit6
  • camel-rocketmq ← downstream of org.apache.camel:camel-test-junit6
  • camel-rss ← downstream of org.apache.camel:camel-test-junit6
  • camel-rxjava ← downstream of org.apache.camel:camel-test-junit6
  • camel-salesforce ← downstream of org.apache.camel:camel-test-junit6
  • camel-salesforce-codegen ← downstream of org.apache.camel:camel-salesforce
  • camel-salesforce-maven-plugin ← downstream of org.apache.camel:camel-test-junit6
  • camel-sap-netweaver ← downstream of org.apache.camel:camel-test-junit6
  • camel-saxon ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-schematron ← downstream of org.apache.camel:camel-test-junit6
  • camel-semantic ← downstream of org.apache.camel:camel-management
  • camel-semantic-openai ← downstream of org.apache.camel:camel-test-junit6
  • camel-semantic-typesafe-ai ← downstream of org.apache.camel:camel-test-junit6
  • camel-semantic-wolf-defender ← downstream of org.apache.camel:camel-test-junit6
  • camel-servicenow ← downstream of org.apache.camel:camel-test-junit6
  • camel-servicenow-maven-plugin ← downstream of org.apache.camel:camel-test-junit6
  • camel-servlet ← downstream of org.apache.camel:camel-management
  • camel-shell ← downstream of org.apache.camel:camel-test-junit5
  • camel-shiro ← downstream of org.apache.camel:camel-test-junit6
  • camel-sjms ← downstream of org.apache.camel:camel-test-junit6
  • camel-sjms2 ← downstream of org.apache.camel:camel-test-junit6
  • camel-slack ← downstream of org.apache.camel:camel-test-junit6
  • camel-smb ← downstream of org.apache.camel:camel-test-junit6
  • camel-smooks ← downstream of org.apache.camel:camel-test-junit6
  • camel-smpp ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-snakeyaml ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-snmp ← downstream of org.apache.camel:camel-test-junit6
  • camel-soap ← downstream of org.apache.camel:camel-test-junit6
  • camel-solr ← downstream of org.apache.camel:camel-test-junit6
  • camel-spiffe ← downstream of org.apache.camel:camel-test-junit6
  • camel-splunk-hec ← downstream of org.apache.camel:camel-test-junit6
  • camel-spring ← downstream of org.apache.camel:camel-cron
  • camel-spring-ai-chat ← downstream of org.apache.camel:camel-test-junit6
  • camel-spring-ai-embeddings ← downstream of org.apache.camel:camel-test-junit6
  • camel-spring-ai-image ← downstream of org.apache.camel:camel-test-junit6
  • camel-spring-ai-vector-store ← downstream of org.apache.camel:camel-test-junit6
  • camel-spring-batch ← downstream of org.apache.camel:camel-test-junit6
  • camel-spring-cloud-config ← downstream of org.apache.camel:camel-test-junit6
  • camel-spring-jdbc ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-spring-ldap ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-spring-main ← downstream of org.apache.camel:camel-main
  • camel-spring-rabbitmq ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-spring-redis ← downstream of org.apache.camel:camel-test-junit6
  • camel-spring-security ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-spring-ws ← downstream of org.apache.camel:camel-attachments
  • camel-spring-xml ← downstream of org.apache.camel:camel-bean
  • camel-sql ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-ssh ← downstream of org.apache.camel:camel-test-junit6
  • camel-state-store ← downstream of org.apache.camel:camel-test-main-junit5
  • camel-stax ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-stitch ← downstream of org.apache.camel:camel-test-junit6
  • camel-stream ← downstream of org.apache.camel:camel-test-junit6
  • camel-streamcaching-test ← downstream of org.apache.camel:camel-test-junit6
  • camel-stringtemplate ← downstream of org.apache.camel:camel-management
  • camel-stripe ← downstream of org.apache.camel:camel-test-junit6
  • camel-swift ← downstream of org.apache.camel:camel-test-junit6
  • camel-syslog ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-tahu ← downstream of org.apache.camel:camel-test-junit6
  • camel-tarfile ← downstream of org.apache.camel:camel-test-junit6
  • camel-telegram ← downstream of org.apache.camel:camel-test-junit6
  • camel-telemetry ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-telemetry-dev ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-tensorflow-serving ← downstream of org.apache.camel:camel-test-junit6
  • camel-test-citrus ← downstream of org.apache.camel:camel-test-junit6
  • camel-test-infra-all ← downstream of org.apache.camel:camel-test-infra-artemis
  • camel-test-infra-artemis ← downstream of org.apache.camel:camel-test-junit6
  • camel-test-infra-smb ← downstream of org.apache.camel:camel-test-junit6
  • camel-test-junit5 ← downstream of org.apache.camel:camel-bean
  • camel-test-junit6 ← downstream of org.apache.camel:camel-bean
  • camel-test-main-junit5 ← downstream of org.apache.camel:camel-management
  • camel-test-main-junit6 ← downstream of org.apache.camel:camel-management
  • camel-test-spring-junit5 ← downstream of org.apache.camel:camel-management
  • camel-test-spring-junit6 ← downstream of org.apache.camel:camel-management
  • camel-thrift ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-thymeleaf ← downstream of org.apache.camel:camel-management
  • camel-tika ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-toon ← downstream of org.apache.camel:camel-test-junit5
  • camel-tracing ← downstream of org.apache.camel:camel-test-spring-junit6
  • camel-twilio ← downstream of org.apache.camel:camel-test-junit6
  • camel-twitter ← downstream of org.apache.camel:camel-test-junit6
  • camel-typesafe-ai ← downstream of org.apache.camel:camel-test-junit6
  • camel-ubl ← downstream of org.apache.camel:camel-test-junit5
  • camel-undertow ← downstream of org.apache.camel:camel-management
  • camel-undertow-spring-security ← downstream of org.apache.camel:camel-test-junit6
  • camel-univocity-parsers ← downstream of org.apache.camel:camel-spring-xml
  • camel-velocity ← downstream of org.apache.camel:camel-management
  • camel-vertx ← downstream of org.apache.camel:camel-test-junit6
  • camel-vertx-http ← downstream of org.apache.camel:camel-test-junit6
  • camel-vertx-websocket ← downstream of org.apache.camel:camel-test-junit6
  • camel-wasm ← downstream of org.apache.camel:camel-test-junit6
  • camel-weather ← downstream of org.apache.camel:camel-test-junit6
  • camel-weaviate ← downstream of org.apache.camel:camel-test-junit6
  • camel-web3j ← downstream of org.apache.camel:camel-test-junit6
  • camel-webhook ← downstream of org.apache.camel:camel-test-junit6
  • camel-whatsapp ← downstream of org.apache.camel:camel-test-junit6
  • camel-wordpress ← downstream of org.apache.camel:camel-test-junit6
  • camel-workday ← downstream of org.apache.camel:camel-test-junit6
  • camel-xchange ← downstream of org.apache.camel:camel-test-junit6
  • camel-xj ← downstream of org.apache.camel:camel-test-junit6
  • camel-xml-io-dsl ← downstream of org.apache.camel:camel-bean
  • camel-xml-jaxb-dsl ← downstream of org.apache.camel:camel-bean
  • camel-xml-jaxb-dsl-test-definition ← downstream of org.apache.camel:camel-bean
  • camel-xml-jaxb-dsl-test-spring ← downstream of org.apache.camel:camel-bean
  • camel-xmlsecurity ← downstream of org.apache.camel:camel-test-junit6
  • camel-xmpp ← downstream of org.apache.camel:camel-test-junit6
  • camel-xslt-saxon ← downstream of org.apache.camel:camel-spring-xml
  • camel-yaml-dsl-validator ← downstream of org.apache.camel:camel-yaml-dsl
  • camel-yaml-dsl-validator-maven-plugin ← downstream of org.apache.camel:camel-yaml-dsl-validator
  • camel-zendesk ← downstream of org.apache.camel:camel-test-junit6
  • camel-zip-deflater ← downstream of org.apache.camel:camel-test-junit6
  • camel-zipfile ← downstream of org.apache.camel:camel-test-junit6
  • camel-zookeeper ← downstream of org.apache.camel:camel-bean
  • camel-zookeeper-master ← downstream of org.apache.camel:camel-test-junit6
Modules with tests skipped (26)
  • apache-camel
  • camel-allcomponents
  • camel-catalog
  • camel-catalog-console
  • camel-catalog-maven
  • camel-catalog-suggest
  • camel-componentdsl
  • camel-endpointdsl
  • camel-endpointdsl-support
  • camel-itest
  • camel-jbang-it
  • camel-jbang-main
  • camel-jbang-plugin-edit
  • camel-jbang-plugin-generate
  • camel-jbang-plugin-kubernetes
  • camel-jbang-plugin-test
  • camel-kamelet-main
  • camel-launcher
  • camel-report-maven-plugin
  • camel-route-parser
  • camel-yaml-dsl
  • camel-yaml-dsl-deserializers
  • camel-yaml-dsl-maven-plugin
  • coverage
  • docs
  • dummy-component

ℹ️ Shadow mode — Scalpel observes but does not affect test execution. Learn more

⚠️ Some tests are disabled on GitHub Actions (@DisabledIfSystemProperty(named = "ci.env.name")) and require manual verification:

  • dsl/camel-jbang/camel-jbang-core: 2 test(s) disabled on GitHub Actions
  • core/camel-core: 4 test(s) disabled on GitHub Actions

💡 Manual integration tests recommended:

You modified dsl/camel-jbang/camel-jbang-core. The related integration tests in dsl/camel-jbang/camel-jbang-it are excluded from CI. Consider running them manually:

mvn verify -f dsl/camel-jbang/camel-jbang-it -Djbang-it-test
Build reactor — dependencies compiled but only changed modules were tested (3 modules, 9.3s total)

Total reactor time: 9.3s

Module Duration Status
Camel :: Bean 9.3s SUCCESS
Camel :: Core n/a
Camel :: JBang :: Core n/a

Top 20 slowest modules:

  • Camel :: Bean (9.3s)

⚙️ View full build and test results

… resultType java.util.Map for the one element of a list

- The source check reports an index after a jsonpath filter (an empty list) and && or || outside a filter (no
  JsonPath), and names the recipe: a filter with resultType: java.util.Map gives the element, or null.
- camel_eval_expression of a jsonpath filter notes that a filter gives a list also for one match, and that a route
  gets the one element with resultType: java.util.Map.
- camel_catalog_doc jsonpath answers the recipe in usage; camel_catalog_find of CamelHttpStatusCode (and similar)
  names CamelHttpResponseCode.
- camel-bean: the hint for an OGNL read on a List leads with the jsonpath recipe; [0] comes after it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01STT6whBgK1AqsSsUKrnE8m

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. No issues found.

The hint reordering in BeanExpression.listHint() correctly prioritises the jsonpath-filter-with-resultType recipe over the [0] indexing shortcut, directly addressing the root cause (models took [0] from the hint and ended up with ${body[0].orderId} instead of the filter recipe).

JsonPathChecks.filterProblem() and outsideFilters() are correct:

  • The INDEX_AFTER_FILTER regex (\[\?\(.*\]\s*\[\s*-?\d+\s*]) fires correctly on $[?(@.orderId==...)][0] and does not false-positive on chained filters like $[?(@.a==1)][?(@.b==2)] (no digit after the second bracket).
  • outsideFilters() depth tracking is sound: j starts at the ( of [?(, depth increments on nested (, decrements on ) until 0, and i = j+2 correctly skips past ) and ].
  • filterNote() in ExpressionEvaluator safely handles null status ("ok".equals(null) is false).

Test coverage is solid: 3 new JsonPathChecksTest cases, 2 CatalogDocsTest, 1 ExpressionEvaluatorLanguageTest, plus the updated SimpleSyntaxHintsTest assertions all track the changed behaviour.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

@oscerd oscerd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TL;DR

The recipe is right where it applies: a filter on a unique field that ends the path gives the element or null (checked against JsonPathExpression.evaluate on main and the jsonpath page). Two of the new messages also offer it where it does not hold, so they are worth tightening before merge. CI is green; the earlier red run came from main's JsonDataFormatReifierTest, which this head's base fixes.

Blockers

  • None

Other findings: 5 (2 non-blocking, 3 suggestions)

  1. Non-blocking — JsonPathChecks.java:112-114, ExpressionEvaluator.java:101-102: INDEX_AFTER_FILTER.find() also matches $[?(@.sku == 'X')][0].qty. If we follow the message there, we get $[?(...)].qty with resultType: java.util.Map, which gives [42]. JsonPathExpression.evaluate (main :182-190) then converts each item to Map. Integer→Map is a converter miss, so the item becomes null, and col.stream().findFirst().get() throws an NPE, which surfaces as an ExpressionEvaluationException. Could we give the Map advice only when the index ends the path (e.g. …\]\s*$), and for [0].field say "leave the index out and set resultType to the field's type"? The eval note has the same gap, because it is added for any filter. The NPE itself has been there since CAMEL-20508, so that part is a follow-up Jira.
  2. Non-blocking — JsonPathChecks.java:118-119: the message says "to test whether a filter matched, set resultType: java.util.Map … check ${body} == null". In a when/filter (where andOutsideAFilterIsNoJsonPath puts it), the filter alone is already that test: ExpressionSupport.matches → ObjectHelper.evaluateValuePredicate reads an empty list as false, as the page's when().jsonpath("$.store.book[?(@.price < 10)]") shows. Map also gives null when several elements match: only size() == 1 is unwrapped, as jsonpath-language.adoc:237-239 notes. So for the message's own example, @.status == 'paid' && @.qty > 0, "matched" would read as no. Suggestion: when SimpleChecks.isPredicate(...) (already used at :85) is true, say "drop the && part, the filter alone is the condition". And add "null also when several match" to ONE_ELEMENT, JSONPATH_ONE_ELEMENT and filterNote.
  3. Suggestion — BeanExpression.java:788-790: noKeysHint still answers ${body[orderId]} on a List with "pick an element first, such as [0][orderId]". That is the same pull toward the first element that this PR removes from listHint, and SimpleTest:549-557 asserts it.
  4. Suggestion — tests: the note's wiring in evaluate() (ExpressionEvaluator.java:86-89) never runs in CI. The only jsonpath evaluate test is gated by camel.test.download, and CI shows ExpressionEvaluatorLanguageTest with "Tests run: 5, Skipped: 1". It would also help to have a [0].qty case, an || case and a valid neighbour such as $.orders[?(@.id == 1)].items[0] to pin the regex.
  5. Suggestion — CatalogDocsTest.java:281: the new test uses FQCNs for CamelCatalog/DefaultCamelCatalog, although both are imported at :25-26.

Reviewed with Claude Code on behalf of oscerd. This review was generated by an AI agent and may contain inaccuracies; please verify all suggestions before applying.

@davsclaus
davsclaus merged commit a04357c into main Oct 21, 2026
6 checks passed
@github-actions
github-actions Bot deleted the fix/CAMEL-25900 branch October 21, 2026 19:57
@davsclaus

Copy link
Copy Markdown
Contributor Author

Thanks @oscerd, the points hold. I merged it now so tonight's benchmark run has it. A follow-up PR will:

  1. give the resultType: java.util.Map advice only when the index ends the path, and for [0].field say to leave the index out and set resultType to the field's type (in the eval note too);
  2. in a when or filter, say that the filter alone is the condition, and add "null also when several match" to the one-element texts;
  3. bring noKeysHint in line with the new list hint;
  4. add tests: the note's wiring without the download gate, a [0].qty case, an || case, and a valid neighbour such as $.orders[?(@.id == 1)].items[0];
  5. use the imports in CatalogDocsTest.

The NPE in JsonPathExpression (a Map result type on a list of values that are not maps, there since CAMEL-20508) gets its own Jira.

Claude Code on behalf of davsclaus

@davsclaus

Copy link
Copy Markdown
Contributor Author

@oscerd the follow-up is #28253, and the NPE in JsonPathExpression (a Map result type on a list of values that are not maps) is filed as CAMEL-25940.

Claude Code on behalf of davsclaus

davsclaus added a commit that referenced this pull request Oct 25, 2026
…path that goes on after the filter, and a when or filter (#28253)

Follow-up of #28210, addressing its review. The resultType java.util.Map advice for a jsonpath filter is given only when an index ends the path; for a path that goes on after the index the answer is the path without the index and a resultType of the value's type. In a when or filter, an index or &&/|| outside the filter is answered with the filter alone as the condition. The no-keys hint for ${body[qty]} on a List leads to the jsonpath filter first, as the list hint does. BeanExpression unwraps a single match before the conversion.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants