davsclaus opened a new pull request, #28057:
URL: https://github.com/apache/camel/pull/28057

   CAMEL-25761: the endpoint checks of the AI validator (`camel validate yaml`, 
`camel_validate_source`, and the write tools of the camel-jbang-mcp server) 
looked for `parameters:` only in the lines right after `uri:`. Any other key of 
the step in between ended the look-ahead:
   
   ```yaml
   - to:
       uri: jms
       variableReceive: answer
       parameters:
         destinationType: queue
         destinationName: stock
   ```
   
   ```
   Line 50: jms: the required option 'destinationName' is missing (the runtime 
says 'Option destinationName is required'): write it in the uri, uri: 
jms:<destinationName>, or under parameters as destinationName: <value>
   ```
   
   The route is valid and runs, but the write tools refuse a file with this 
error. The other checks of those options (unknown option, wrong value, 
placeholders) were skipped too. `id:` between `uri:` and `parameters:`, and 
`parameters:` above `uri:`, gave the same result. Found while writing a JMS 
request-reply example (apache/camel-jbang-examples#115). None of the r17 
benchmark runs hit it, because models write `parameters` right after `uri`.
   
   ## What
   
   - **`id:` or `variableReceive:` between `uri:` and `parameters:`:** the 
look-ahead now continues to the end of the step's mapping, instead of stopping 
at the first other key.
   - **`parameters:` above `uri:`:** found by a backward search among the keys 
of the same mapping (`keyBefore`). It stops at the line that starts the step, 
so the parameters of the step before are never taken.
   
   ## Tests
   
   - 
`SourceValidatorPlaceholderTest.theParametersAreFoundWhereverTheyStandInTheStep`
 (new):
     - `variableReceive:` and `id:` between `uri:` and `parameters:`: no false 
required-option error.
     - A misspelled option behind `id:` is now reported on its own line.
     - `parameters:` above `uri:`: no false error.
     - Without the option anywhere in the step, it is still reported.
   - All camel-jbang-core tests pass (2532).
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   https://claude.ai/code/session_01STT6whBgK1AqsSsUKrnE8m
   


-- 
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]

Reply via email to