gnodet-bot commented on code in PR #27168:
URL: https://github.com/apache/camel/pull/27168#discussion_r4154140139
##########
catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/odata.json:
##########
@@ -0,0 +1,62 @@
+{
+ "component": {
+ "kind": "component",
+ "name": "odata",
+ "title": "OData",
+ "description": "Camel OData Component",
+ "deprecated": false,
+ "firstVersion": "4.23.0",
Review Comment:
⚠️ **Stale generated file:** This catalog-level JSON was generated from the
Regen commit and not updated after the latest commit. It still has:
- `"label": "http,cloud"` (should be `"http"` — `Category.CLOUD` was removed
in `ODataEndpoint.java`)
- `"secret": false` on `authPassword` and `authBearerToken` (should be
`true` — `security = "secret"` was added in `ODataConfiguration.java`)
The component's own `META-INF/.../odata.json` is correct. A regen pass (`mvn
generate-resources` from the repo root, or the Camel `regen` workflow) will
sync this.
Also:
`catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/others.properties`
still lists `odata`, and `catalog/.../others/odata.json` still exists with the
stale "other" descriptor. These should be removed by the regen (now that
`other.properties` was deleted from the component).
##########
components/camel-odata/src/main/docs/odata-component.adoc:
##########
@@ -0,0 +1,406 @@
+= OData Component
+:doctitle: OData
+:shortname: odata
+:artifactid: camel-odata
+:description: Camel OData Component
+:since: 4.23
+:supportlevel: Preview
+:tabs-sync-option:
+:component-header: Only producer is supported
+
+*Since Camel {since}*
+
+*{component-header}*
+
+The OData component allows you to interact with OData V4 services using
standard OData CRUD operations.
+
+The component provides OData-specific request and response handling while
using Camel HTTP as the underlying HTTP transport.
+
+The OData component is the successor to the deprecated `camel-olingo4`
component.
+
+The component supports OData V4 services using JSON representations.
+
+Maven users will need to add the following dependency to their `pom.xml` for
this component:
+
+[source,xml]
+
+<dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-odata</artifactId>
+ <version>x.x.x</version>
+ <!-- use the same version as your Camel core version -->
+</dependency>
+----
+
+== URI Format
+
+=== odata:httpUri
+
+Where `httpUri` is the base URL of the OData entity set or resource.
+
+For example:
+
+[source,text]
+
+odata:http://localhost:8080/odata/Products
+odata:https://services.odata.org/V4/Northwind/Northwind.svc/Categories
+----------------------------------------------------------------------
+
+The URI can also contain endpoint options as query parameters.
+
+The OData query options can alternatively be configured on the endpoint or
supplied dynamically using message headers.
+
+The component uses Camel HTTP for the underlying HTTP transport.
+
+// component options: START
+include::partial$component-configure-options.adoc[]
+include::partial$component-endpoint-options.adoc[]
+include::partial$component-endpoint-headers.adoc[]
+// component options: END
+
+# [NOTE]
+
+# This is a producer-only component. Per-message options can be supplied
through `CamelOData` headers in addition to endpoint options.
+
+# [NOTE]
+
+# If the route receives messages from an untrusted producer, take care when
forwarding internal Camel headers to this component. In particular, an inbound
`Authorization` header can be used for the OData request and takes precedence
over endpoint authentication.
+
+== Operations
+
+The operation is selected using the `CamelODataOperation` message header or
the `operation` endpoint option.
+
+The following operations are supported:
+
+[cols="20%,15%,65%",options="header"]
+|===
+| Operation | HTTP Method | Description
+
+| `READ_SET`
+| `GET`
+| Reads a collection of entities. This is the default operation.
+
+| `READ_ENTRY`
+| `GET`
+| Reads a single entity. Use `CamelODataKey` to specify the entity key.
+
+| `CREATE`
+| `POST`
+| Creates a new entity using the message body as the request payload.
+
+| `UPDATE`
+| `PATCH`
+| Updates an existing entity using `CamelODataKey` to identify the entity.
+
+| `DELETE`
+| `DELETE`
+| Deletes an existing entity using `CamelODataKey` to identify the entity.
+|===
+
+For `READ_ENTRY`, `UPDATE`, and `DELETE`, the key is appended to the
configured resource URI.
+
+For example:
+
+[source,text]
+
+CamelODataKey = 101
+odata:http://localhost:8080/odata/Products
+------------------------------------------
+
+results in:
+
+[source,text]
+
+http://localhost:8080/odata/Products(101)
+
+The key is treated as an OData key expression. The component does not
automatically add quotes or otherwise change the supplied key value.
+
+For example, a string key can be supplied as `'ABC-123'`, while a composite
key can be supplied as `ProductID=101,CategoryID=5`.
+
+The key value should be a valid and trusted OData key expression.
+
+== Message Headers
+
+The following message headers can be used to control OData processing
dynamically.
+
+[cols="25%,20%,55%",options="header"]
+|===
+| Header | Type | Description
+
+| `CamelODataOperation`
+| `ODataOperation` / `String`
+| Specifies the operation to execute.
+
+| `CamelODataKey`
+| `String`
+| Specifies the key for `READ_ENTRY`, `UPDATE`, and `DELETE` operations.
+
+| `CamelODataFilter`
+| `String`
+| Overrides the `$filter` query option.
+
+| `CamelODataSelect`
+| `String`
+| Overrides the `$select` query option.
+
+| `CamelODataExpand`
+| `String`
+| Overrides the `$expand` query option.
+
+| `CamelODataOrderBy`
+| `String`
+| Overrides the `$orderby` query option.
+
+| `CamelODataTop`
+| `Integer`
+| Overrides the `$top` query option.
+
+| `CamelODataSkip`
+| `Integer`
+| Overrides the `$skip` query option.
+
+| `CamelODataIncludeCount`
+| `Boolean`
+| Controls whether the `$count` query option is included in the request.
+
+| `CamelODataETag`
+| `String`
+| Supplies an ETag for the `If-Match` HTTP request header. The component also
populates this header from an ETag returned by the OData service.
+
+| `CamelODataCount`
+| `Long`
+| Contains the count returned by the OData service when an `@odata.count`
value is present.
+
+| `CamelODataNextLink`
+| `String`
+| Contains the `@odata.nextLink` value returned by the OData service when
present.
+
+| `CamelHttpResponseCode`
+| `Integer`
+| Contains the HTTP response status code returned by the OData service.
+|===
+
+A message-level `Authorization` header can also be supplied.
+
+When an `Authorization` header is present, it takes precedence over
authentication configured on the OData endpoint.
+
+If the OData route is exposed to an upstream HTTP consumer, such as
`platform-http`, take care that an inbound `Authorization` header may be
forwarded to the OData service.
+
+If the upstream authorization credentials must not be forwarded, remove the
header before sending the exchange to the OData component.
+
+For example:
+
+[source,java]
+
+from("platform-http:/products")
+.removeHeader("Authorization")
+.to("odata:http://my-odata-service/odata/Products");
+----------------------------------------------------
+
+== Query Options
+
+The component supports the following OData query options:
+
+[cols="25%,20%,55%",options="header"]
+|===
+| Option | Type | Description
+
+| `filter`
+| `String`
+| OData `$filter` expression.
+
+| `select`
+| `String`
+| OData `$select` expression.
+
+| `expand`
+| `String`
+| OData `$expand` expression.
+
+| `orderBy`
+| `String`
+| OData `$orderby` expression.
+
+| `top`
+| `Integer`
+| OData `$top` value.
+
+| `skip`
+| `Integer`
+| OData `$skip` value.
+
+| `count`
+| `Boolean`
+| Controls the OData `$count` query option.
+|===
+
+For example:
+
+[source,text]
+
+odata:http://localhost:8080/odata/Products?filter=Name%20eq%20%27Laptop%27&select=Name,Price&top=10
+
+Query options configured through message headers take precedence over the
corresponding endpoint configuration.
+
+== Authentication
+
+The component supports Basic authentication and Bearer token authentication
through endpoint options.
+
+For example, Basic authentication can be configured using:
+
+[source,text]
+
+odata:http://localhost:8080/odata/Products?authMethod=Basic&authUsername=user&authPassword=password
+
+Bearer token authentication can be configured using the `authBearerToken`
option.
+
+Authentication can also be supplied dynamically using the message-level
`Authorization` header:
+
+[source,java]
+
+from("direct:getProducts")
+.setHeader("Authorization", constant("Bearer my-token"))
+.to("odata:http://my-odata-service/odata/Products");
+----------------------------------------------------
+
+When an `Authorization` header is present on the message, it takes precedence
over endpoint authentication.
+
+Take care when forwarding exchanges from an upstream HTTP consumer because the
incoming `Authorization` header may be forwarded to the OData service.
+
+== ETags
+
+The component supports optimistic concurrency using OData/HTTP ETags.
+
+An ETag supplied in `CamelODataETag` is sent to the service using the HTTP
`If-Match` header.
+
+For example:
+
+[source,java]
+
+from("direct:updateProduct")
+.setHeader("CamelODataOperation", constant("UPDATE"))
+.setHeader("CamelODataKey", constant("101"))
+.setHeader("CamelODataETag", constant("W/"etag-value""))
Review Comment:
⚠️ **Invalid Java (still present):** `constant("W/"etag-value"")` has
unescaped quotes — this is not valid Java. The same issue is on line 379.
The correct escaped form would be:
```
.setHeader("CamelODataETag", constant("W/\"etag-value\""))
```
##########
components/camel-odata/src/main/docs/odata-component.adoc:
##########
@@ -0,0 +1,406 @@
+= OData Component
+:doctitle: OData
+:shortname: odata
+:artifactid: camel-odata
+:description: Camel OData Component
+:since: 4.23
+:supportlevel: Preview
+:tabs-sync-option:
+:component-header: Only producer is supported
+
+*Since Camel {since}*
+
+*{component-header}*
+
+The OData component allows you to interact with OData V4 services using
standard OData CRUD operations.
+
+The component provides OData-specific request and response handling while
using Camel HTTP as the underlying HTTP transport.
+
+The OData component is the successor to the deprecated `camel-olingo4`
component.
+
+The component supports OData V4 services using JSON representations.
+
+Maven users will need to add the following dependency to their `pom.xml` for
this component:
+
+[source,xml]
+
+<dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-odata</artifactId>
+ <version>x.x.x</version>
+ <!-- use the same version as your Camel core version -->
+</dependency>
+----
+
+== URI Format
+
+=== odata:httpUri
+
+Where `httpUri` is the base URL of the OData entity set or resource.
+
+For example:
+
+[source,text]
+
+odata:http://localhost:8080/odata/Products
+odata:https://services.odata.org/V4/Northwind/Northwind.svc/Categories
+----------------------------------------------------------------------
+
+The URI can also contain endpoint options as query parameters.
+
+The OData query options can alternatively be configured on the endpoint or
supplied dynamically using message headers.
+
+The component uses Camel HTTP for the underlying HTTP transport.
+
+// component options: START
+include::partial$component-configure-options.adoc[]
+include::partial$component-endpoint-options.adoc[]
+include::partial$component-endpoint-headers.adoc[]
+// component options: END
+
+# [NOTE]
Review Comment:
⚠️ **AsciiDoc syntax (still broken):** Lines 61–67 use `# [NOTE]` (Markdown
heading prefix) instead of AsciiDoc admonition syntax. In AsciiDoc, a NOTE
block should be:
```
[NOTE]
====
This is a producer-only component.
====
```
or inline: `NOTE: This is a producer-only component.`
The `#` prefix renders as a literal `#` character in the Antora docs, not as
an admonition.
--
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]