davsclaus opened a new pull request, #26758:
URL: https://github.com/apache/camel/pull/26758
```yaml
- to:
uri: "http://localhost:8080/stock/${header.sku}"
```
The endpoint of a `to:` is resolved once when the route starts, so the
placeholder is sent as the text it is — url-encoded into the path — and every
call fails. In the AI route benchmark two runs spent themselves on
`http://localhost:8080/stock/$%7Bbody.sku%7D`, hundreds of redeliveries deep,
before anything said why. The validator now says it, so `camel validate` and
the camel-jbang MCP write/edit tools catch it before the route ever runs:
> to: the uri holds an expression (${header.sku}) but the endpoint of a to:
is fixed when the route starts, so it is sent as text: write toD: to build the
uri for each message
**Where it deliberately stays quiet** — the check is narrow on purpose:
- only the path, never the options after the `?`, so the file component's
`fileName=${date:now:yyyyMMdd}` is fine on a plain `to:`
- `:#${...}`, the parameter the sql family binds per message
- components that read their path as a script or a statement: `language`,
`sql`, `sql-stored`, `elsql`, `jdbc`, `spring-jdbc`, `mybatis`, `xquery`, `xslt`
- `{{property.placeholders}}`, which are resolved at startup and are not
expressions
The check ran against every YAML example in the EIP pages, the component
pages and the user manual (the doc-example tests). After the exclusions above,
exactly one block was flagged: the one on the to-eip page that the page itself
introduces with "This snippet is not valid code" to explain why `toD` exists. A
block can now carry `// yaml-validator: skip` to stay out of the validation and
out of the samples, which also takes that invalid route out of
`eip-samples.json` — the samples `camel_catalog_sample` hands to an agent as
examples.
Tests: `YamlValidatorDynamicUriTest` (the mistake in both forms, `toD`
accepted, and the sql, language, file-option and property-placeholder cases),
plus the doc-example suites. Full validator module: 140 green. Full reactor
build green.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01Bp3538HRBPMQkb5ta9xRaj
--
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]