davsclaus commented on code in PR #28314:
URL: https://github.com/apache/camel/pull/28314#discussion_r4353462676


##########
components/camel-aws/camel-aws2-lambda/src/main/java/org/apache/camel/component/aws2/lambda/Lambda2Endpoint.java:
##########
@@ -33,6 +34,33 @@
 @UriEndpoint(firstVersion = "3.2.0", scheme = "aws2-lambda", title = "AWS 
Lambda", syntax = "aws2-lambda:function",
              producerOnly = true, category = { Category.CLOUD, 
Category.SERVERLESS },
              headersClass = Lambda2Constants.class)
+@BodyTypes(producerIn = @BodyType(value = { Carrier.TEXT, Carrier.BYTES, 
Carrier.STREAM, Carrier.FILE },

Review Comment:
   Changed in 07d5493da7ad: the input side is `any` now, with the body of 
invokeFunction, createFunction and updateFunction as option values, as the 
other components of this PR have it. For the record, the default did not apply 
to the other 28 operations: the side had `dependsOn = "operation"`, which makes 
an operation without an option value not known. `any` with the exceptions says 
it more plainly.
   
   _Claude Code on behalf of davsclaus_



##########
components/camel-aws/camel-aws2-lambda/src/main/java/org/apache/camel/component/aws2/lambda/Lambda2Endpoint.java:
##########
@@ -33,6 +34,33 @@
 @UriEndpoint(firstVersion = "3.2.0", scheme = "aws2-lambda", title = "AWS 
Lambda", syntax = "aws2-lambda:function",
              producerOnly = true, category = { Category.CLOUD, 
Category.SERVERLESS },
              headersClass = Lambda2Constants.class)
+@BodyTypes(producerIn = @BodyType(value = { Carrier.TEXT, Carrier.BYTES, 
Carrier.STREAM, Carrier.FILE },
+                                  dependsOn = "operation",
+                                  byOption = {
+                                          @BodyType.When(option = "operation", 
value = "invokeFunction",
+                                                         carriers = {
+                                                                 Carrier.TEXT, 
Carrier.BYTES, Carrier.STREAM, Carrier.FILE }),
+                                          @BodyType.When(option = "operation", 
value = "createFunction",
+                                                         carriers = {
+                                                                 
Carrier.BYTES, Carrier.STREAM, Carrier.FILE, Carrier.NULL }),
+                                          @BodyType.When(option = "operation", 
value = "updateFunction",
+                                                         carriers = {
+                                                                 
Carrier.BYTES, Carrier.STREAM, Carrier.FILE, Carrier.NULL }) },
+                                  description = "The payload of 
invokeFunction, the default, as JSON text: bytes, a stream or a"
+                                                + " file are read as text, a 
Map or a POJO is sent as its toString(), so"
+                                                + " marshal it first, and no 
body fails. createFunction and updateFunction take"
+                                                + " the zip of the code as 
bytes, a stream or a file, or no body with the"
+                                                + " CamelAwsLambdaZipFile 
header or the S3 headers. The other operations take"
+                                                + " their input from headers, 
or with pojoRequest=true from the request of the"
+                                                + " AWS SDK in the body"),
+           producerOut = @BodyType(value = Carrier.TEXT, javaType = 
"java.lang.String", dependsOn = "operation",

Review Comment:
   With `dependsOn = "operation"` it was not redundant: without it, a step with 
`operation=invokeFunction` was not known. In 07d5493da7ad the output side is 
the response of the AWS SDK (`pojo`), and the option value of invokeFunction 
says text, so it now differs from the side.
   
   _Claude Code on behalf of davsclaus_



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