davsclaus opened a new pull request, #29185: URL: https://github.com/apache/camel/pull/29185
https://issues.apache.org/jira/browse/CAMEL-26594 In the YAML DSL, `parameters:` is a map, so a value should be taken as it is written. `YamlSupport.createEndpointUri` added the values to the uri without encoding them, so a value with an `&` was cut at the `&`, and the rest became another option. `filterFile: "${file:name} contains 'R&D'"` failed to start ("expected symbol singleQuote but was eol"), and a lenient component took a cut value with no error (vertx-http `basicAuthUsername: "u&v"` gave `u`). Only secret options were kept whole, in `RAW(...)`. **camel-yaml-dsl** (first commit) - A value with an `&` is now put in RAW, as the secrets are: `RAW(...)`, or `RAW{...}` when the value has `)&`. Values that start with `#`, `RAW(` or `RAW{`, and values that are not text, are left as they are. A value no RAW form can hold is left as today. - Only query options are wrapped, never path options. The `EndpointUriFactory` cannot tell them apart, so for a uri that is only the scheme the uri is built first, and an option that ended up in the path is built again as written. - `from`, `to`, `toD`, `wireTap`, `poll`, the `switch` uris, `asEndpoint` and the `kamelet` EIP (which had the same bug through its own query string) are covered. - `+` and `%XX` in other values are read as before (cron values in uri form use `+` for a space). - The 4.24 upgrade guide and the YAML DSL page say what changed, and when a value must still be written in RAW: an `&` that comes from a property placeholder, or one inside a map option. - `ParametersAmpersandTest`: 12 tests, each failing on main. Among them a file filter with `&&` that really filters files, a path option with an `&`, `{{placeholders}}`, a `#bean`, a value already in RAW, and a `toD` with `${header.dept} & ${header.team}` that writes `R&D & Ops.txt`. **camel-jbang AI tools** (second commit) - The check from CAMEL-26591 refused such a value and said to write it in RAW. It now accepts it, and passes it on in the same RAW form, so the other uri checks see what the runtime sees. - It still reports where the runtime cuts the value: an entry of a map option (write it in RAW), a value that starts with `#` (write it in RAW, the reference still works), and a value no RAW form can hold (put it in a property and use `#property:name`, which was checked at runtime). Before, that last case gave no message. - `SourceValidatorEndpointTest`: 55 tests; the two new ones fail on main. Over the benchmark traces (20,078 final step files) the validator gives the same output as before. **Tests:** camel-yaml-dsl-common 10, camel-yaml-dsl-deserializers 2, camel-yaml-dsl 509, camel-kamelet-main 66 (8 skipped), camel-jbang-core 2,590 + 300 (3 skipped). 🤖 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]
