oscerd commented on PR #28956:
URL: https://github.com/apache/camel/pull/28956#issuecomment-6588615841

   Thanks, Claus.
   
   1. Upgrade guide wording: done. The entry now says that before, 
`createSecret` stored the text the type converter gives (usually `toString()`). 
It also says that a POJO with its own type converter to `String`, or a JAXB 
object, is now stored as the JSON of its properties, and that 
`convertBodyTo(String.class)` before `createSecret` keeps the text of the 
converter.
   
   Following up on this point: an XML `Source` was affected as well. A 
`DOMSource` went through Jackson and was stored as the bean wrapper 
`{"node":"<xml>","systemId":null,"empty":false}`, where the type converter used 
to give the XML text. `KeyVaultProducer.isPayload` now treats a 
`javax.xml.transform.Source` as a payload, so it is read as text with the type 
converter, as before the PR. `KeyVaultProducerTest.xmlIsStoredAsItsText` covers 
a `DOMSource` and a DOM `Document`. The document needed no change, as Jackson 
writes a DOM node as a JSON string.
   
   2. JavaTimeModule: done. `jackson-datatype-jsr310` is a compile dependency 
of azure-core (camel-azure-key-vault, then azure-security-keyvault-secrets, 
then azure-core), with its version managed by the Camel parent. It reaches the 
module the same way as the `jackson-databind` the module already uses. The 
mapper of `KeyVaultProducer` is now `JsonMapper.builder().addModule(new 
JavaTimeModule()).disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS).build()`.
 I turned the timestamps off so that a date is stored as ISO-8601 text, such as 
`"2026-01-01T12:30:00Z"`, rather than a number such as `1767270600.000000000`: 
it stays readable, and the `azure:` properties function can read it as a text 
field. `KeyVaultProducerTest.dateAndTimeInAMapOrPojoAreStoredAsIsoText` covers 
a Map with an `OffsetDateTime`, which failed with an `IllegalArgumentException` 
before this change, and a record with a `LocalDate`. A date or a time that is 
the whole body is still stored as its text.
   
   _Claude Code on behalf of Andrea Cosentino (oscerd)_
   


-- 
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