You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "ammachado (via GitHub)" <gi...@apache.org> on 2026/06/30 19:56:03 UTC

[PR] CAMEL-23863: Fix invalid YAML in rest-api jbang example and add example-loading test [camel]

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

   # Description
   
   Fixes [CAMEL-23863](https://issues.apache.org/jira/browse/CAMEL-23863).
   
   Running `camel run --example=rest-api` failed at startup:
   
   ```
   ERROR ... org.apache.camel.main.MainSupport : Error starting Camel:
   Error constructing YAML node id: rest
    in file:.../rest-api.camel.yaml, line 2, column 5:
           path: /api
           ^
   ```
   
   **Root cause:** the bundled `rest-api.camel.yaml` placed a `steps:` key under `rest:` and defined verbs without a `to:` target. `steps` is not a valid property of the REST DSL `<rest>` element; verbs (`get`/`post`/`put`/`delete`) must be direct children of `rest`, each a list whose entries carry a `to:` target. The failure happens during route-model construction (not pure YAML parsing), which is why the reported position points at the first child line of the `rest` node.
   
   **Changes:**
   
   - Correct the verb structure in `dsl/camel-jbang/camel-jbang-core/src/main/resources/examples/rest-api/rest-api.camel.yaml` so the verbs are children of `rest` with `to:` targets routing `GET /api/hello` and `GET /api/hello/{name}` to `direct:hello` / `direct:hello-name` (the two routes the example already defines).
   - Add `ExampleRoutesLoadTest`, a parameterized test that loads every bundled example under `camel-jbang-core` through the routes loader, guarding all examples against this class of regression. A `camel.example.Greeter` test fixture mirrors the runtime-compiled bean so the `routes/beans.yaml` example parses.
   
   Verified the test fails on the pre-fix file with the original `Error constructing YAML node id: rest`, and passes after the fix (14 example cases).
   
   # Target
   
   - [x] I checked that the commit is targeting the correct branch (Camel 4 uses the `main` branch)
   
   # Tracking
   - [x] If this is a large change, bug fix, or code improvement, I checked there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for the change (usually before you start working on it).
   
   # Apache Camel coding standards and style
   
   - [x] I checked that each commit in the pull request has a meaningful subject line and body.
   - [x] I have run `mvn clean install -DskipTests` locally from root folder and I have committed all auto-generated changes.
   
   # AI-assisted contributions
   
   - [x] If this PR includes AI-generated code, commits have proper co-authorship attribution (e.g., `Co-authored-by` trailers) and the PR description identifies the AI tool used.
   
   _Authored with Claude Code (Opus 4.8) on behalf of Adriano Machado._
   
   🤖 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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-23863: Fix invalid YAML in rest-api jbang example and add example-loading test [camel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #24340:
URL: https://github.com/apache/camel/pull/24340#issuecomment-4847583625

   <!-- ci-tested-modules -->
   :test_tube: **CI tested the following changed modules:**
   
   - `dsl/camel-jbang/camel-jbang-core`
   
   :warning: **Some tests are disabled on GitHub Actions** (`@DisabledIfSystemProperty(named = "ci.env.name")`) and require manual verification:
   
   - `dsl/camel-jbang/camel-jbang-core`: 1 test(s) disabled on GitHub Actions
   
   :bulb: **Manual integration tests recommended:**
   
   > You modified `dsl/camel-jbang/camel-jbang-core`. The related integration tests in `dsl/camel-jbang/camel-jbang-it` are excluded from CI. Consider running them manually:
   > ```
   > mvn verify -f dsl/camel-jbang/camel-jbang-it -Djbang-it-test
   > ```
   
   <details><summary>All tested modules (7 modules)</summary>
   
   - Camel :: JBang :: Core
   - Camel :: JBang :: MCP
   - Camel :: JBang :: Plugin :: MCP
   - Camel :: JBang :: Plugin :: Route Parser
   - Camel :: JBang :: Plugin :: TUI
   - Camel :: JBang :: Plugin :: Validate
   - Camel :: Launcher :: Container
   
   </details>
   
   ---
   :gear: [View full build and test results](https://github.com/apache/camel/actions/runs/28471944868)


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-23863: Fix invalid YAML in rest-api jbang example and add example-loading test [camel]

Posted by "ammachado (via GitHub)" <gi...@apache.org>.
ammachado commented on PR #24340:
URL: https://github.com/apache/camel/pull/24340#issuecomment-4847706632

   PR description updated with link to apache/camel-jbang-examples fix.


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-23863: Fix invalid YAML in rest-api jbang example and add example-loading test [camel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #24340:
URL: https://github.com/apache/camel/pull/24340#issuecomment-4847422407

   :star2: Thank you for your contribution to the Apache Camel project! :star2:
     :robot: CI automation will test this PR automatically.
   
     :camel: Apache Camel Committers, please review the following items:
   
     * First-time contributors **require MANUAL approval** for the GitHub Actions to run
     * You can use the command `/component-test (camel-)component-name1 (camel-)component-name2..` to request a test from the test bot although they are normally detected and executed by CI.
     * You can label PRs using `skip-tests` and `test-dependents` to fine-tune the checks executed by this PR.
     * Build and test logs are available in the summary page. **Only** [Apache Camel committers](https://camel.apache.org/community/team/#committers) have access to the summary.
     
     :warning: Be careful when sharing logs. Review their contents before sharing them publicly.


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-23863: Fix invalid YAML in rest-api jbang example and add example-loading test [camel]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus merged PR #24340:
URL: https://github.com/apache/camel/pull/24340


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-23863: Fix invalid YAML in rest-api jbang example and add example-loading test [camel]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on PR #24340:
URL: https://github.com/apache/camel/pull/24340#issuecomment-4847677148

   you need to fix this in camel-jbang-examples as these in core project are copied over from there via a maven sync profile.


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org