Andrea Cosentino created CAMEL-27097:
----------------------------------------

             Summary: Body types page - the application-json example still says 
the transformer takes any body
                 Key: CAMEL-27097
                 URL: https://issues.apache.org/jira/browse/CAMEL-27097
             Project: Camel
          Issue Type: Bug
          Components: documentation
            Reporter: Andrea Cosentino


Follow-up of CAMEL-26300 ([PR 
#29215|https://github.com/apache/camel/pull/29215]), found while fixing it.

The "Data type transformers" section of the body types page 
(docs/user-manual/modules/ROOT/pages/body-types.adoc, main 73fe55b4f931, lines 
231-238) says that {{application-json}} writes any object as JSON bytes, and 
shows:

{noformat}
"transformerIn": { "carriers": [ "any" ] },
"transformerOut": { "carriers": [ "bytes" ], "javaType": "byte[]", "format": 
"json" }
{noformat}

Since CAMEL-26300 the transformer ({{JsonDataTypeTransformer}} of 
camel-jackson, lines 45-56, and the same in camel-jackson3) takes text, bytes, 
a stream, a Map, a List, a POJO or null. Other text than a Json object or array 
becomes a Json string, bytes and a stream are read as text with the exchange 
charset, and with the {{X-Content-Class}} exchange property it takes only a 
Json object or array as text or a body of that class. The catalog entry 
(transformers/application-json.json) says the same.

Proposed: show the current catalog entry (shortened), or a transformer with 
simpler body types, and reword the sentence.

_Claude Code on behalf of Andrea Cosentino (oscerd)_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to