davsclaus opened a new pull request, #3145:
URL: https://github.com/apache/camel-kamelets/pull/3145

   _Claude Code on behalf of Claus Ibsen_
   
   A batch of Kamelets rewritten to the documentation standard proposed in 
#3140, `docs/modules/ROOT/pages/documenting.adoc`, like #3141–#3143.
   
   This batch has 13 actions:
   - the field actions `drop-field-action`, `extract-field-action`, 
`hoist-field-action`, `insert-field-action`, `mask-field-action` and 
`replace-field-action`;
   - `set-body-action`;
   - `avro-serialize-action`, `avro-deserialize-action`, 
`protobuf-serialize-action` and `protobuf-deserialize-action`;
   - `data-type-action` and `resolve-pojo-schema-action`.
   
   **Every one was run**, on Camel 4.23.0 and 4.24.0-SNAPSHOT. The descriptions 
state what holds on the released 4.23.
   
   ## Facts that were missing before
   
   - **Field actions:**
     - they work on the top-level fields of a JSON object;
     - the body comes back as JSON text only when `Content-Type` is 
`application/json`, and otherwise as parsed JSON;
     - a missing field is ignored.
   - **`extract-field-action`:**
     - a text value keeps its JSON quotes unless `trimField` is true;
     - `headerOutput` puts the value in a header instead of the body.
   - **`replace-field-action`:** `enabled` keeps only the listed fields, and 
`disabled` removes them.
   - **`mask-field-action`:** a number field needs a numeric replacement, and 
true/false values cannot be masked.
   - **`insert-field-action`:**
     - it replaces an existing field;
     - on a JSON array it appends the value;
     - the value is always text, and Simple expressions such as `${header.x}` 
work.
   - **Avro and Protobuf:**
     - serialize needs parsed JSON (a Map or `JsonNode`), so put 
`json-deserialize-action` before it;
     - the output is bytes, with the schema not inside them;
     - deserialize gives a `JsonNode`;
     - the schema can come from `resolve-pojo-schema-action` instead of the 
`schema` option.
   - **`data-type-action`:** says in plain words what a data type is, points to 
`camel catalog transformer` for the list, and gives the body in and out of the 
common ones.
   - **`resolve-pojo-schema-action`:** it leaves the body as it is, and stores 
the schema for the next step.
   
   ## Found on the way, not changed here
   
   - **On Camel 4.24.0-SNAPSHOT, all these actions fail.** The `json` data 
format is now Jackson 3, and these templates name Jackson 2 classes:
     - The six field actions fail on every message with `Content-Type: 
application/json`. Their `unmarshal: json: unmarshalType: 
com.fasterxml.jackson.databind.JsonNode` step throws `Cannot construct instance 
of com.fasterxml.jackson.databind.JsonNode`. 18 Kamelets in the catalog use 
that `unmarshalType`.
     - The Avro and Protobuf actions fail at startup.
     - `data-type-action` with `avro-binary` or `protobuf-binary`, after 
`resolve-pojo-schema-action`, fails with "Missing proper avro/Protobuf schema".
   
     All of this works on 4.22 and 4.23. It needs a decision before the catalog 
moves to Camel 4.24.
   - **The Avro `validate` option has no effect.** Messages that do not match 
the schema fail even with `validate: false`. The descriptions say so.
   - **`protobuf-serialize-action` labels JSON text `application/protobuf`** 
without converting it.
   - **A Camel runtime issue, for apache/camel:** two routes that use the 
`kamelet:` EIP with the same Kamelet and the same parameters share it. Messages 
from the first route continue in the second route's later steps (4.23 and 
4.24). A plain `to: kamelet:...` is fine.
   
   ## Notes for review
   
   - No template, type, default or required list was changed. The `dataTypes` 
blocks are `headers` only, with no `default`.
   - This PR is based on `main`; if #3140 merges first, I will rebase it and 
regenerate the index.
   
   `./mvnw clean install` from the root passes.
   
   🤖 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to