This is an automated email from the ASF dual-hosted git repository.

nferraro pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git

commit 105f180de2ff0b81e856f8bcbf54bbc8ab16cc6e
Author: nicolaferraro <[email protected]>
AuthorDate: Mon Jun 7 10:26:44 2021 +0200

    Avoid property leak
---
 .../serialization/InflightProtobufSchemaResolver.java    | 16 ++++++++++++++++
 protobuf-deserialize-action.kamelet.yaml                 |  7 ++++++-
 protobuf-serialize-action.kamelet.yaml                   |  4 +++-
 3 files changed, 25 insertions(+), 2 deletions(-)

diff --git 
a/library/camel-kamelets-utils/src/main/java/org/apache/camel/kamelets/utils/serialization/InflightProtobufSchemaResolver.java
 
b/library/camel-kamelets-utils/src/main/java/org/apache/camel/kamelets/utils/serialization/InflightProtobufSchemaResolver.java
index f4d39dd..4d09f9d 100644
--- 
a/library/camel-kamelets-utils/src/main/java/org/apache/camel/kamelets/utils/serialization/InflightProtobufSchemaResolver.java
+++ 
b/library/camel-kamelets-utils/src/main/java/org/apache/camel/kamelets/utils/serialization/InflightProtobufSchemaResolver.java
@@ -1,3 +1,19 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
 package org.apache.camel.kamelets.utils.serialization;
 
 import java.io.IOException;
diff --git a/protobuf-deserialize-action.kamelet.yaml 
b/protobuf-deserialize-action.kamelet.yaml
index 212502d..490b5ea 100644
--- a/protobuf-deserialize-action.kamelet.yaml
+++ b/protobuf-deserialize-action.kamelet.yaml
@@ -32,10 +32,15 @@ spec:
     from:
       uri: kamelet:source
       steps:
+      - set-property:
+          name: schema
+          constant: "{{schema}}"
       - unmarshal:
-          protobuf: 
+          protobuf:
             library: Jackson
             unmarshalTypeName: com.fasterxml.jackson.databind.JsonNode
             schemaResolver: 
"#class:org.apache.camel.kamelets.utils.serialization.InflightProtobufSchemaResolver"
+      - remove-property:
+          property-name: schema
       - remove-header:
           header-name: "Content-Type"
diff --git a/protobuf-serialize-action.kamelet.yaml 
b/protobuf-serialize-action.kamelet.yaml
index c5ce0bd..7b9a67b 100644
--- a/protobuf-serialize-action.kamelet.yaml
+++ b/protobuf-serialize-action.kamelet.yaml
@@ -36,10 +36,12 @@ spec:
           name: schema
           constant: "{{schema}}"
       - marshal:
-          protobuf: 
+          protobuf:
             library: Jackson
             unmarshalTypeName: com.fasterxml.jackson.databind.JsonNode
             schemaResolver: 
"#class:org.apache.camel.kamelets.utils.serialization.InflightProtobufSchemaResolver"
+      - remove-property:
+          property-name: schema
       - set-header:
           name: "Content-Type"
           constant: "application/protobuf"

Reply via email to