davsclaus commented on code in PR #27168:
URL: https://github.com/apache/camel/pull/27168#discussion_r4164728456
##########
components/camel-odata/src/main/docs/odata-component.adoc:
##########
@@ -0,0 +1,414 @@
+= 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.
+|===
+
+Additional OData query options can be supplied as endpoint URI parameters.
Because the component uses lenient endpoint properties, options that are not
defined as explicit component options are passed through as OData query
parameters. Ensure that endpoint option names are spelled correctly and that
any additional options are valid OData query options.
+
+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");
+----
Review Comment:
yeah the AI now have tools to do this for us, so we just ask it to do it
afterwards as a chore PR
--
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]