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

   Item 3 of [CAMEL-26933](https://issues.apache.org/jira/browse/CAMEL-26933).
   
   ## Problem
   
   `camel generate rest --routes` writes a route for each REST operation 
(`RestDslYamlGenerator`), and those routes neither validate nor run:
   
   - each route has no `steps`,
   - the operation's `description` sits under `from`, which has none.
   
   With the module's own petstore spec, `camel validate yaml` reports 19 
errors, and `camel run` fails with "Route updatePet has no output processors". 
So the flow in `camel-jbang-projects.adoc` was broken.
   
   On the launcher from main:
   
   ```
   $ camel generate rest --input=petstore-v3.json --routes --output=rest.yaml
   $ camel run rest.yaml --port=0 --max-seconds=4
   ... Route ... has no output processors ...      # 6 times, the routes do not 
start
   ```
   
   ## Change
   
   - `RestDslYamlGenerator` puts the description on the route, where the YAML 
DSL has it.
   - Each route gets one placeholder step, `log: "Not implemented yet: 
direct:<name>"`, to replace with the implementation.
   - `camel-jbang-projects.adoc` says so.
   
   ```yaml
   - route:
       description: "Update Pet Data"
       from:
         uri: "direct:rest1"
         steps:
         - log: "Not implemented yet: direct:rest1"
   ```
   
   After, on the launcher with the patched generator jar: the generated routes 
start, and the run ends normally after `--max-seconds`.
   
   ## Tests
   
   - `CodeRestGeneratorTest.theRoutesOfTheRestDslValidate` (new): `generate 
rest --routes` on the petstore spec, then the YAML DSL validator on the output, 
with no errors. Against the generator of main, it fails with `required property 
'steps' not found` for each route.
   - The expected outputs of `RestDslYamlGeneratorV3SimpleWithRoutesTest` and 
`...WithRoutesDescriptionTest` are updated.
   - End to end with the launcher, as above.
   - camel-openapi-rest-dsl-generator: 50 tests pass. 
camel-jbang-plugin-generate: 6 tests pass.
   
   _Claude Code on behalf of davsclaus_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


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