Conversation
Signed-off-by: Andrea Cosentino <ancosen@gmail.com>
Signed-off-by: Andrea Cosentino <ancosen@gmail.com>
Signed-off-by: Andrea Cosentino <ancosen@gmail.com>
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
gnodet
left a comment
There was a problem hiding this comment.
GoogleCloudVisionConfiguration has both:
- String operation (UriPath — set from the URI remaining, e.g., google-vision:labelDetection)
- GoogleCloudVisionOperations operationType (UriParam — typed enum)
In GoogleCloudVisionProducer.determineOperation() (line 167-183), the logic is:
- Check message header
- Check operationType (enum)
- Check operation (string) → parse to enum via valueOf()
The operation UriPath is always set by GoogleCloudVisionComponent.createEndpoint() (line 47: configurationCopy.setOperation(remaining)), but it's the string name of the
operation, not a separate concept. So operationType and operation represent the same thing in two different types. This is confusing for users — they might set both, and
precedence is unclear.
Suggestion: Either remove operationType and just use the operation string (parsed to enum internally), or make operation a GoogleCloudVisionOperations UriPath (like other Camel components that use enums in the path). Having both is a source of confusion.
I'll push a commit to fix along with other minor issues.
- Add error check in processPojo() (was missing unlike processImage()) - Use RuntimeCamelException instead of raw RuntimeException - Use enhanced switch expressions (Java 21+) - Use List.of() instead of ArrayList for single-element lists - Remove unnecessary static getMessageForResponse() helper - Make endpoint field final Signed-off-by: Guillaume Nodet <gnodet@gmail.com>
The operation is already specified in the URI path (e.g., google-vision:labelDetection). Having a separate operationType query parameter with the same purpose is confusing. Remove it and simplify the producer's operation resolution. Signed-off-by: Guillaume Nodet <gnodet@gmail.com>
|
yarn gulp failures are unrelated |
Description
Target
mainbranch)Tracking
Apache Camel coding standards and style
mvn clean install -DskipTestslocally from root folder and I have committed all auto-generated changes.