You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2020/09/17 09:11:00 UTC

[camel] 01/02: CAMEL-15478: Docs should include API documentation

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

davsclaus pushed a commit to branch api
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 507f14b127ac7f050e238c000728ac23105eb684
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Thu Sep 17 10:46:33 2020 +0200

    CAMEL-15478: Docs should include API documentation
---
 .../apache/camel/maven/packaging/MvelHelper.java   |  5 +++
 .../src/main/resources/endpoint-options.mvel       | 41 ++++++++++++++++++++++
 2 files changed, 46 insertions(+)

diff --git a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/MvelHelper.java b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/MvelHelper.java
index 1d3af19..64a5e23 100644
--- a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/MvelHelper.java
+++ b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/MvelHelper.java
@@ -43,4 +43,9 @@ public final class MvelHelper {
 
         return escapedUrls;
     }
+
+    public static String formatSignature(String signature) {
+        signature = signature.replace('$', '.');
+        return signature + ";";
+    }
 }
diff --git a/tooling/maven/camel-package-maven-plugin/src/main/resources/endpoint-options.mvel b/tooling/maven/camel-package-maven-plugin/src/main/resources/endpoint-options.mvel
index 2fde5f1..625e174 100644
--- a/tooling/maven/camel-package-maven-plugin/src/main/resources/endpoint-options.mvel
+++ b/tooling/maven/camel-package-maven-plugin/src/main/resources/endpoint-options.mvel
@@ -30,3 +30,44 @@ The @{title} endpoint has no query parameters.
 @end{}|===
 @end{}
 
+@if{!apiOptions.isEmpty()}
+
+=== Query API Parameters (@{apiOptions.size()} APIs):
+
+The @{title} endpoint is an API based component and has additional parameters based on which API name and method in use.
+The API name and method is located in the endpoint URI as the @{apiPropertyQualifier} path parameters:
+
+----
+@{syntax}
+----
+
+The following lists each API name and method and its additional parameters.
+
+@foreach{api : apiOptions}
+==== @{api.name}
+@if{api.methods.isEmpty()}
+The @{api.name} has no API methods.
+@else{}
+
+The @{api.name} has @{api.methods.size} API method(s) which is represented by the following method signatures
+(an API method may have multiple signatures due to overloading):
+
+[source,java]
+----
+@foreach{method : api.methods}@foreach{signature : method.signatures}
+@{util.formatSignature(signature)}
+@end{}@end{}
+----
+
+The API methods has the following set of options listed in the following table:
+[width="100%",cols="1,2,5,2",options="header"]
+|===@comment{ Render table cells. If description contains newline, prefix cell with `a`, so the content is rendered with formatting. }
+| Method | Name | Description | Type
+@foreach{method : api.methods}@foreach{row : method.options}| @{method.name} | *@{row.getShortName(30)}* @{row.description.?contains("\n") ? "a" : ""}| @{util.escape(row.description)} | @{row.getShortJavaType()}
+@end{}@end{}|===
+
+
+@end{}
+@end{}
+
+@end{}