Skip to content

CAMEL-23863: Fix invalid YAML in rest-api example#68

Merged
davsclaus merged 1 commit into
apache:mainfrom
ammachado:CAMEL-23863-fix-rest-api-yaml
Jul 1, 2026
Merged

CAMEL-23863: Fix invalid YAML in rest-api example#68
davsclaus merged 1 commit into
apache:mainfrom
ammachado:CAMEL-23863-fix-rest-api-yaml

Conversation

@ammachado

Copy link
Copy Markdown
Contributor

Motivation

The rest-api example's rest-api.camel.yaml nests the GET verbs under an unsupported steps: key:

- rest:
    path: /api
    steps:
      - get:
          path: /hello
      - get:
          path: "/hello/{name}"

The Camel YAML DSL has no steps: child under rest:; verbs belong directly under get:/post:/etc. As a result the example fails at parse time (UnsupportedFieldException) and camel run --example=rest-api does not start.

Fix

Use the proper get: verb list with explicit to: targets wiring each verb to its direct route, matching the canonical Camel YAML rest DSL structure:

- rest:
    path: /api
    get:
      - path: /hello
        to:
          uri: direct:hello
      - path: "/hello/{name}"
        to:
          uri: direct:hello-name

The two direct:hello / direct:hello-name routes already present in the file remain unchanged.

Related

This is the upstream source for the bundled example that is synced into apache/camel via the sync-example-catalog Maven profile. The same fix has been applied on the camel side, together with a new ExampleRoutesLoadTest that loads and parses every bundled example through the routes loader to prevent this class of regression:

Without this upstream change, the next example-catalog sync would re-introduce the broken file.


Claude Code on behalf of Adriano Machado

The rest DSL block nested the GET verbs under an unsupported `steps:`
key, which the Camel YAML DSL rejects at parse time. Use the proper
`get:` verb list with explicit `to:` targets wiring each verb to its
direct route, matching the canonical Camel YAML rest DSL structure.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ammachado
ammachado force-pushed the CAMEL-23863-fix-rest-api-yaml branch from 74cc20d to 3410363 Compare July 1, 2026 03:32
@davsclaus
davsclaus merged commit 5b23b7d into apache:main Jul 1, 2026
1 check failed
@ammachado
ammachado deleted the CAMEL-23863-fix-rest-api-yaml branch July 1, 2026 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants