Dhairya-007 commented on PR #29971:
URL: https://github.com/apache/camel/pull/29971#issuecomment-6892495631
Thanks — point 2 is fixed, with your `.orElse(...)` kept.
`CatalogBodyTypes.dataFormat` now reads:
```java
name = names.stream()
.filter(n -> n.equalsIgnoreCase(wanted) || n.equalsIgnoreCase(key +
wanted))
.findFirst()
// ApacheAvro, GoogleProtobuf: the data format named like the model
.orElse(names.contains(key) ? key : null);
```
So `avro: {}` → `Jackson` → `avroJackson`, `avro: {library: ApacheAvro}` →
`avro`, and `protobuf: {}` → `GoogleProtobuf` → `protobuf`, which as you say
never resolved before either. `json` is unaffected: `jackson`, `gson`,
`fastjson` and `jsonb` still match directly, and `names.contains("json")` is
false so the fallback stays out of it.
`testTheBodyOfBinaryDataFormats` now has an `avroApache` route with
`library: ApacheAvro` and `instanceClassName: com.acme.Order` beside the
default one, and expects both to be reported. Watching CI to confirm — I have
no local Camel build to run it against.
--
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]