davsclaus opened a new pull request, #28849: URL: https://github.com/apache/camel/pull/28849
https://issues.apache.org/jira/browse/CAMEL-26484 In the r25 run of the local-model benchmark (qwen3.6 35B on Ollama), contracts-rest-code-first step 1 passed in 2 of 7 rounds, against 5 of 7 in r24. The step asks to answer one order by its id, or 404. The validator accepted routes that then failed on every request: - `${bodyAs(List).?[orderId == '${header.id}']}` and `${body[?(@.orderId == '${header.id}')]}`: a SpEL or JsonPath filter inside Simple, which Simple reads as a method or a key. - jsonpath `$[?(...)] {resultType: java.util.Map}`: the model copied the words of the List message into the text of the path (InvalidPathException). - jsonpath `$[?(@.orderId == '{id}')]`: the text `{id}`, not the path parameter, so every id got 404. - The JSON answer of the 404 under `json:`: it was told "did you mean 'js'?" 4 times, then wrote it as jsonpath, which failed on a null body. **What changes, at write time** - A JsonPath or SpEL filter inside a Simple function is reported, with the jsonpath step that picks the element, as YAML lines. - The text of a jsonpath expression is read as a path. Text after the path, a bracket or a quote that is not closed, and a JSON text are reported, with the lines to write. - The JsonPath library is not added: with the JSON parser it needs, it would be four more jars in the CLI. - So the check is light, and it reports only what the JsonPath compiler refuses. - `{id}` is reported when a REST operation with the path parameter id reaches the route. This covers a simple, constant or jsonpath text, and a log message. The message says it is the literal text, and that the path parameter is the header `${header.id}`. - The REST operations of the other files of the project count too, and so does an OpenAPI specification a file binds to. - `json:` under `expression:` gets the answer that json is a data format, not a language. It gives the JSON text with constant, or with simple when it has `${...}`. This replaces "did you mean 'js'?". - The List message (#28636) gives the jsonpath step as YAML lines, with `expression:` and `resultType:` as two keys. When the route's own path parameter matches the field, it uses that header. **Tests** - camel-yaml-dsl-validator: 339 tests pass. - The AI tool tests in camel-jbang-core: 825 tests pass, with 1 skipped as before. - The new checks report nothing on these: - the reference files of the benchmark steps; - the YAML examples of the simple, jsonpath and REST DSL docs (66); - the 1238 right final versions of the r24 and r25 runs. - Every r25 write that the validator accepted and that then failed at runtime is now refused. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_016Y4dDi5iQNgtHrDdz2NpwF -- 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]
