camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject camel git commit: camel-connector - Fix a little issue in the maven plugin
Date Wed, 22 Feb 2017 11:22:05 GMT
Repository: camel
Updated Branches:
  refs/heads/master 8622f48b7 -> 130bec905


camel-connector - Fix a little issue in the maven plugin


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/130bec90
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/130bec90
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/130bec90

Branch: refs/heads/master
Commit: 130bec905f2ed9bb5ef81c4b1d1b2c48146f96fc
Parents: 8622f48
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Wed Feb 22 12:21:52 2017 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Wed Feb 22 12:21:52 2017 +0100

----------------------------------------------------------------------
 .../org/apache/camel/maven/connector/ConnectorMojo.java     | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/130bec90/connectors/camel-connector-maven-plugin/src/main/java/org/apache/camel/maven/connector/ConnectorMojo.java
----------------------------------------------------------------------
diff --git a/connectors/camel-connector-maven-plugin/src/main/java/org/apache/camel/maven/connector/ConnectorMojo.java
b/connectors/camel-connector-maven-plugin/src/main/java/org/apache/camel/maven/connector/ConnectorMojo.java
index df192d9..960b630 100644
--- a/connectors/camel-connector-maven-plugin/src/main/java/org/apache/camel/maven/connector/ConnectorMojo.java
+++ b/connectors/camel-connector-maven-plugin/src/main/java/org/apache/camel/maven/connector/ConnectorMojo.java
@@ -321,7 +321,10 @@ public class ConnectorMojo extends AbstractJarMojo {
     private String buildComponentHeaderSchema(List<Map<String, String>> rows,
Map dto, String gitUrl) throws Exception {
         String baseScheme = (String) dto.get("baseScheme");
         String title = (String) dto.get("name");
-        String scheme = StringHelper.camelCaseToDash(title);
+        String scheme = (String) dto.get("scheme");
+        if (scheme == null || scheme.isEmpty()) {
+            scheme = StringHelper.camelCaseToDash(title);
+        }
         String baseSyntax = getOption(rows, "syntax");
         String syntax = baseSyntax.replaceFirst(baseScheme, scheme);
 
@@ -354,7 +357,9 @@ public class ConnectorMojo extends AbstractJarMojo {
         sb.append("    \"syntax\": \"" + syntax + "\",\n");
         sb.append("    \"title\": \"" + title + "\",\n");
         if (description != null) {
-            sb.append("    \"description\": \"" + description + "\",\n");
+            // ensure description is sanitized
+            String text = JSonSchemaHelper.sanitizeDescription(description, false);
+            sb.append("    \"description\": \"" + text + "\",\n");
         }
         if (label != null) {
             sb.append("    \"label\": \"" + label + "\",\n");


Mime
View raw message