urunni88 opened a new pull request, #27112: URL: https://github.com/apache/camel/pull/27112
# Description **JIRA:** https://issues.apache.org/jira/browse/CAMEL-24803 camel-knative sets and reads the CloudEvent headers, but `KnativeEndpoint` had no `headersClass`, so the component JSON had no headers section. As a result the headers table on the knative doc page was empty, and `camel validate` rejected routes using e.g. `${header.CamelCloudEventType}`. This PR declares the headers with `@Metadata` in the existing `KnativeConstants` class and references it via `headersClass` on `KnativeEndpoint`. The component JSON and the knative entry in the catalog are regenerated. The eight headers are the attributes of the current CloudEvents spec version as defined in `CloudEventAttributes` (camel-api), which is the set knative copies between the CloudEvent and the Camel headers: `CamelCloudEventID`, `CamelCloudEventSource`, `CamelCloudEventVersion`, `CamelCloudEventType`, `CamelCloudEventDataContentType`, `CamelCloudEventSchemaURL`, `CamelCloudEventSubject`, `CamelCloudEventTime`. Notes: - The constants reference `CloudEvent.CAMEL_CLOUD_EVENT_*` so the names stay in sync with camel-api. - They use `label = "common"`, as they apply to both consumer and producer. - The descriptions follow `AbstractCloudEventProcessor`: the producer defaults ID, source, spec version and time only when the header is not set, and on an event endpoint with a type ID in the URI, the type ID takes precedence over the type header. Out of scope: the other components that set the same CloudEvent headers (the "wider" part of the JIRA). Once this is in, the knative doc examples from CAMEL-24720 could also use `${header.CamelCloudEventType}` in validated examples. Tests: camel-knative 4/4 passed. AI assistance: investigation and changes were done with help from Claude (Anthropic). I reviewed and verified the changes, build and tests locally. # 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. Built camel-knative and camel-catalog; the generated component JSON and the catalog's knative entry are committed. # 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. -- 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]
