Claus Ibsen created CAMEL-26075:
-----------------------------------
Summary: camel-aws2-transcribe - no operation fails with a
NullPointerException, and createVocabulary sends a List of phrases as one phrase
Key: CAMEL-26075
URL: https://issues.apache.org/jira/browse/CAMEL-26075
Project: Camel
Issue Type: Bug
Components: camel-aws2
Affects Versions: 4.18.0, 4.22.0, 4.23.0
Reporter: Claus Ibsen
Fix For: 4.24.0
Found while adding the catalog body types of aws2-transcribe (CAMEL-24961).
h4. 1. No operation fails with a NullPointerException
The operation option has no default and there is no operation header, so
{{switch (getConfiguration().getOperation())}} ({{Transcribe2Producer}}, main
ed3d719b379c, line 50) fails with a NullPointerException when the endpoint sets
no operation. Checked on 4.24.0-SNAPSHOT with {{camel run}} against the AWS
emulator of {{camel infra run aws}}.
*Proposed change*: require the operation when the endpoint is created.
h4. 2. createVocabulary sends a List of phrases as one phrase
createVocabulary reads {{CamelAwsTranscribeVocabularyPhrases}} as a String
(lines 325-327), while the catalog says it is a {{List<String>}} and the
vocabulary filters read it as a List. A List of phrases is sent as one phrase.
Checked on 4.24.0-SNAPSHOT with {{camel run}} against a fake of the AWS API
that logs the requests it gets: the header {{['camel', 'kamelet']}} gives
{{"Phrases":["[camel, kamelet]"]}}. createVocabulary never reads
{{CamelAwsTranscribeVocabularyFileUri}}, and updateVocabulary reads neither.
*Proposed change*: read the header as a List, and the file uri too.
h4. 3. Two delete operations keep the body
deleteTranscriptionJob and deleteVocabulary never set the body (lines 268-295
and 450-477), while the other four delete operations set their response.
Checked on 4.24.0-SNAPSHOT with {{camel run}} against the AWS emulator of
{{camel infra run aws}}: after deleteVocabulary the body is still the response
of the step before.
*Proposed change*: set the response, as the other delete operations do.
h4. Also read in the code, not run
* {{Transcribe2Component}} (lines 68-72) refuses an endpoint without a
transcribeClient or an accessKey and a secretKey, also with
{{useDefaultCredentialsProvider}} or {{useProfileCredentialsProvider}}, which
the page offers.
* The page names an {{amazonTranscribeClient}}; the option is
{{transcribeClient}}, and it is not autowired.
_Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)