davsclaus opened a new pull request, #27809: URL: https://github.com/apache/camel/pull/27809
## Summary Fixes [CAMEL-25636](https://issues.apache.org/jira/browse/CAMEL-25636). `MarshalDefinition` and `UnmarshalDefinition` built their label and `toString()` from `DataFormatDefinition.toString()`, which most data formats do not override. So the route structure, and the route diagrams drawn from it (`camel cmd route-diagram`, the `route-diagram` dev console, the camel-jbang monitor), showed the object: ``` unmarshal[org.apache.camel.model.dataformat.JsonDataFormat@5a3cf824] ``` ## Changes The label (and `toString()`) now use the name of the data format, `DataFormatDefinition.getDataFormatName()`. That is the name Camel resolves the data format by, so `json` with the Jackson library shows as `unmarshal[jackson]` (with Gson as `gson`), `csv` as `marshal[csv]`, bindy as `bindyCsv`, and so on. - A data format given as an instance (`marshal(new MyDataFormat())`) has no name, so its class name is shown, such as `marshal[MyDataFormat]`. - Data formats with neither keep their `toString()`, as before (for example `custom` shows `CustomDataFormat[myRef]`). Only the labels of the model change. The runtime `MarshalProcessor` / `UnmarshalProcessor` labels are unchanged. ## Tests - `MarshalUnmarshalDefinitionLabelTest` in camel-core: json (Jackson and Gson), csv, a data format instance, custom, and no data format. - Ran the marshal, data format and model dump tests in camel-core: 73 tests pass. _Claude Code on behalf of davsclaus_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_018bTvXZpqkVoW3s4zneh5d7 -- 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]
