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/15 15:57:05 UTC
[camel] 16/22: CAMEL-15478: api-component should generate @ApiParam
with more fine grained details so we know which parameter is for which api
method.
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 3d33d6958ce975d0459f20508fdbb1fe6b68d3f9
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue Sep 15 13:49:59 2020 +0200
CAMEL-15478: api-component should generate @ApiParam with more fine grained details so we know which parameter is for which api method.
---
components/camel-olingo4/camel-olingo4-api/pom.xml | 42 ++++------------------
.../camel-olingo4/camel-olingo4-component/pom.xml | 14 +++++++-
.../olingo4/Olingo4AppEndpointConfiguration.java | 28 +++++++--------
.../apache/camel/component/olingo4/olingo4.json | 2 +-
.../src/signatures/olingo-api-signature.txt | 9 -----
5 files changed, 34 insertions(+), 61 deletions(-)
diff --git a/components/camel-olingo4/camel-olingo4-api/pom.xml b/components/camel-olingo4/camel-olingo4-api/pom.xml
index 730004a..63e48b8 100644
--- a/components/camel-olingo4/camel-olingo4-api/pom.xml
+++ b/components/camel-olingo4/camel-olingo4-api/pom.xml
@@ -96,26 +96,17 @@
<plugins>
- <!-- to generate API Javadoc -->
<plugin>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-javadoc-plugin</artifactId>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <version>3.2.1</version>
<executions>
<execution>
- <id>add-javadoc</id>
+ <id>attach-sources</id>
+ <phase>verify</phase>
<goals>
- <goal>jar</goal>
+ <goal>jar-no-fork</goal>
</goals>
- <configuration>
- <attach>true</attach>
- <source>${jdk.version}</source>
- <quiet>true</quiet>
- <detectOfflineLinks>false</detectOfflineLinks>
- <javadocVersion>1.8.0</javadocVersion>
- <encoding>UTF-8</encoding>
- <doclint>none</doclint>
- <locale>en</locale>
- </configuration>
</execution>
</executions>
</plugin>
@@ -123,25 +114,4 @@
</plugins>
</build>
- <!-- Disable Java 8 doclint checks to avoid Javadoc plugin failures -->
- <profiles>
- <profile>
- <id>doclint-java8-disable</id>
- <activation>
- <jdk>[1.8,</jdk>
- </activation>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <configuration>
- <additionalparam>-Xdoclint:none</additionalparam>
- </configuration>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
</project>
diff --git a/components/camel-olingo4/camel-olingo4-component/pom.xml b/components/camel-olingo4/camel-olingo4-component/pom.xml
index bfb1d39..357b212 100644
--- a/components/camel-olingo4/camel-olingo4-component/pom.xml
+++ b/components/camel-olingo4/camel-olingo4-component/pom.xml
@@ -119,11 +119,14 @@
<api>
<apiName />
<proxyClass>org.apache.camel.component.olingo4.api.Olingo4App</proxyClass>
- <fromSignatureFile>src/signatures/olingo-api-signature.txt</fromSignatureFile>
+ <fromJavasource>
+ <includeMethods>read|uread|delete|create|update|patch|merge|batch|action</includeMethods>
+ </fromJavasource>
<extraOptions>
<extraOption>
<name>keyPredicate</name>
<type>java.lang.String</type>
+ <description>OData Key predicate</description>
</extraOption>
</extraOptions>
<nullableOptions>
@@ -138,6 +141,15 @@
</configuration>
</execution>
</executions>
+ <dependencies>
+ <!-- Component API to read API -->
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-olingo4-api</artifactId>
+ <version>${project.version}</version>
+ <classifier>sources</classifier>
+ </dependency>
+ </dependencies>
</plugin>
<plugin>
<!-- we need to generate additional configurer classes -->
diff --git a/components/camel-olingo4/camel-olingo4-component/src/generated/java/org/apache/camel/component/olingo4/Olingo4AppEndpointConfiguration.java b/components/camel-olingo4/camel-olingo4-component/src/generated/java/org/apache/camel/component/olingo4/Olingo4AppEndpointConfiguration.java
index ea4e1c2..162966f 100644
--- a/components/camel-olingo4/camel-olingo4-component/src/generated/java/org/apache/camel/component/olingo4/Olingo4AppEndpointConfiguration.java
+++ b/components/camel-olingo4/camel-olingo4-component/src/generated/java/org/apache/camel/component/olingo4/Olingo4AppEndpointConfiguration.java
@@ -14,31 +14,31 @@ import org.apache.camel.spi.UriParams;
/**
* Camel endpoint configuration for {@link org.apache.camel.component.olingo4.api.Olingo4App}.
*/
-@ApiParams(apiName = "DEFAULT", description = "",
- apiMethods = {@ApiMethod(methodName = "action"), @ApiMethod(methodName = "batch"), @ApiMethod(methodName = "create"), @ApiMethod(methodName = "delete"), @ApiMethod(methodName = "merge"), @ApiMethod(methodName = "patch"), @ApiMethod(methodName = "read"), @ApiMethod(methodName = "update"), @ApiMethod(methodName = "uread")})
+@ApiParams(apiName = "DEFAULT", description = "Olingo4 Client Api Interface",
+ apiMethods = {@ApiMethod(methodName = "action", description="Calls a OData action"), @ApiMethod(methodName = "batch", description="Executes a batch request"), @ApiMethod(methodName = "create", description="Creates a new OData resource"), @ApiMethod(methodName = "delete", description="Deletes an OData resource and invokes callback with org"), @ApiMethod(methodName = "merge", description="Patches/merges an OData resource using HTTP MERGE"), @ApiMethod(methodName = "patch", descr [...]
@UriParams
@Configurer
public final class Olingo4AppEndpointConfiguration extends Olingo4Configuration {
@UriParam
- @ApiParam(apiMethods = {@ApiMethod(methodName = "action"), @ApiMethod(methodName = "batch"), @ApiMethod(methodName = "create"), @ApiMethod(methodName = "merge"), @ApiMethod(methodName = "patch"), @ApiMethod(methodName = "update")})
+ @ApiParam(apiMethods = {@ApiMethod(methodName = "action", description="Action data"), @ApiMethod(methodName = "batch", description="Ordered org.apache.camel.component.olingo4.api.batch.Olingo4BatchRequest list"), @ApiMethod(methodName = "create", description="Request data"), @ApiMethod(methodName = "merge", description="Patch/merge data"), @ApiMethod(methodName = "patch", description="Patch/merge data"), @ApiMethod(methodName = "update", description="Updated data")})
private Object data;
@UriParam
- @ApiParam(apiMethods = {@ApiMethod(methodName = "action"), @ApiMethod(methodName = "batch"), @ApiMethod(methodName = "create"), @ApiMethod(methodName = "merge"), @ApiMethod(methodName = "patch"), @ApiMethod(methodName = "read"), @ApiMethod(methodName = "update"), @ApiMethod(methodName = "uread")})
+ @ApiParam(apiMethods = {@ApiMethod(methodName = "action", description="Service Edm"), @ApiMethod(methodName = "batch", description="Service Edm"), @ApiMethod(methodName = "create", description="Service Edm"), @ApiMethod(methodName = "merge", description="Service Edm"), @ApiMethod(methodName = "patch", description="Service Edm"), @ApiMethod(methodName = "read", description="Service Edm, read from calling read(null, $metdata, null, responseHandler)"), @ApiMethod(methodName = "update", [...]
private org.apache.olingo.commons.api.edm.Edm edm;
@UriParam
- @ApiParam(apiMethods = {@ApiMethod(methodName = "action"), @ApiMethod(methodName = "batch"), @ApiMethod(methodName = "create"), @ApiMethod(methodName = "delete"), @ApiMethod(methodName = "merge"), @ApiMethod(methodName = "patch"), @ApiMethod(methodName = "read"), @ApiMethod(methodName = "update"), @ApiMethod(methodName = "uread")})
- private java.util.Map<String,String> endpointHttpHeaders;
+ @ApiParam(apiMethods = {@ApiMethod(methodName = "action", description="HTTP Headers to add/override the component versions"), @ApiMethod(methodName = "batch", description="HTTP Headers to add/override the component versions"), @ApiMethod(methodName = "create", description="HTTP Headers to add/override the component versions"), @ApiMethod(methodName = "delete", description="HTTP Headers to add/override the component versions"), @ApiMethod(methodName = "merge", description="HTTP Header [...]
+ private java.util.Map<String, String> endpointHttpHeaders;
@UriParam
@ApiParam(apiMethods = {})
private java.lang.String keyPredicate;
@UriParam
- @ApiParam(apiMethods = {@ApiMethod(methodName = "read"), @ApiMethod(methodName = "uread")})
- private java.util.Map<String,String> queryParams;
+ @ApiParam(apiMethods = {@ApiMethod(methodName = "read", description="OData query params http://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part1-protocol.html#_Toc453752288"), @ApiMethod(methodName = "uread", description="OData query params http://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part1-protocol.html#_Toc453752288")})
+ private java.util.Map<String, String> queryParams;
@UriParam
- @ApiParam(apiMethods = {@ApiMethod(methodName = "action"), @ApiMethod(methodName = "create"), @ApiMethod(methodName = "delete"), @ApiMethod(methodName = "merge"), @ApiMethod(methodName = "patch"), @ApiMethod(methodName = "read"), @ApiMethod(methodName = "update"), @ApiMethod(methodName = "uread")})
+ @ApiParam(apiMethods = {@ApiMethod(methodName = "action", description="Resource path to action"), @ApiMethod(methodName = "create", description="Resource path to create"), @ApiMethod(methodName = "delete", description="Resource path for Entry"), @ApiMethod(methodName = "merge", description="Resource path to update"), @ApiMethod(methodName = "patch", description="Resource path to update"), @ApiMethod(methodName = "read", description="OData Resource path"), @ApiMethod(methodName = "upd [...]
private String resourcePath;
@UriParam
- @ApiParam(apiMethods = {@ApiMethod(methodName = "action"), @ApiMethod(methodName = "batch"), @ApiMethod(methodName = "create"), @ApiMethod(methodName = "delete"), @ApiMethod(methodName = "merge"), @ApiMethod(methodName = "patch"), @ApiMethod(methodName = "read"), @ApiMethod(methodName = "update"), @ApiMethod(methodName = "uread")})
+ @ApiParam(apiMethods = {@ApiMethod(methodName = "action", description="Org.apache.olingo.client.api.domain.ClientEntity callback handler"), @ApiMethod(methodName = "batch", description="Callback handler"), @ApiMethod(methodName = "create", description="Callback handler"), @ApiMethod(methodName = "delete", description="Org.apache.olingo.commons.api.http.HttpStatusCode callback handler"), @ApiMethod(methodName = "merge", description="Org.apache.olingo.client.api.domain.ClientEntity cal [...]
private org.apache.camel.component.olingo4.api.Olingo4ResponseHandler responseHandler;
public Object getData() {
@@ -57,11 +57,11 @@ public final class Olingo4AppEndpointConfiguration extends Olingo4Configuration
this.edm = edm;
}
- public java.util.Map<String,String> getEndpointHttpHeaders() {
+ public java.util.Map<String, String> getEndpointHttpHeaders() {
return endpointHttpHeaders;
}
- public void setEndpointHttpHeaders(java.util.Map<String,String> endpointHttpHeaders) {
+ public void setEndpointHttpHeaders(java.util.Map<String, String> endpointHttpHeaders) {
this.endpointHttpHeaders = endpointHttpHeaders;
}
@@ -73,11 +73,11 @@ public final class Olingo4AppEndpointConfiguration extends Olingo4Configuration
this.keyPredicate = keyPredicate;
}
- public java.util.Map<String,String> getQueryParams() {
+ public java.util.Map<String, String> getQueryParams() {
return queryParams;
}
- public void setQueryParams(java.util.Map<String,String> queryParams) {
+ public void setQueryParams(java.util.Map<String, String> queryParams) {
this.queryParams = queryParams;
}
diff --git a/components/camel-olingo4/camel-olingo4-component/src/generated/resources/org/apache/camel/component/olingo4/olingo4.json b/components/camel-olingo4/camel-olingo4-component/src/generated/resources/org/apache/camel/component/olingo4/olingo4.json
index 919eb53..298305e 100644
--- a/components/camel-olingo4/camel-olingo4-component/src/generated/resources/org/apache/camel/component/olingo4/olingo4.json
+++ b/components/camel-olingo4/camel-olingo4-component/src/generated/resources/org/apache/camel/component/olingo4/olingo4.json
@@ -79,6 +79,6 @@
"sslContextParameters": { "kind": "parameter", "displayName": "Ssl Context Parameters", "group": "security", "label": "security", "required": false, "type": "object", "javaType": "org.apache.camel.support.jsse.SSLContextParameters", "deprecated": false, "secret": false, "configurationClass": "org.apache.camel.component.olingo4.Olingo4Configuration", "configurationField": "configuration", "description": "To configure security using SSLContextParameters" }
},
"apiProperties": {
- "DEFAULT": { "apiName": "DEFAULT", "methods": { "action": { "apiMethodName": "action", "description": "", "properties": { "responseHandler": { "kind": "parameter", "displayName": "Response Handler", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.olingo4.api.Olingo4ResponseHandler", "deprecated": false, "secret": false, "description": "" } } }, "batch": { "apiMethodName": "batch", "description": "", "properties": { "respons [...]
+ "DEFAULT": { "apiName": "DEFAULT", "methods": { "action": { "apiMethodName": "action", "description": "Org.apache.olingo.client.api.domain.ClientEntity callback handler", "properties": { "responseHandler": { "kind": "parameter", "displayName": "Response Handler", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.olingo4.api.Olingo4ResponseHandler", "deprecated": false, "secret": false, "description": "" } } }, "batch": { "api [...]
}
}
diff --git a/components/camel-olingo4/camel-olingo4-component/src/signatures/olingo-api-signature.txt b/components/camel-olingo4/camel-olingo4-component/src/signatures/olingo-api-signature.txt
deleted file mode 100644
index 66a2110..0000000
--- a/components/camel-olingo4/camel-olingo4-component/src/signatures/olingo-api-signature.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-void read(org.apache.olingo.commons.api.edm.Edm edm, String resourcePath, java.util.Map<String, String> queryParams, java.util.Map<String, String> endpointHttpHeaders, org.apache.camel.component.olingo4.api.Olingo4ResponseHandler responseHandler);
-void uread(org.apache.olingo.commons.api.edm.Edm edm, String resourcePath, java.util.Map<String, String> queryParams, java.util.Map<String, String> endpointHttpHeaders, org.apache.camel.component.olingo4.api.Olingo4ResponseHandler responseHandler);
-void delete(String resourcePath, java.util.Map<String, String> endpointHttpHeaders, org.apache.camel.component.olingo4.api.Olingo4ResponseHandler responseHandler);
-void create(org.apache.olingo.commons.api.edm.Edm edm, String resourcePath, java.util.Map<String, String> endpointHttpHeaders, Object data, org.apache.camel.component.olingo4.api.Olingo4ResponseHandler responseHandler);
-void update(org.apache.olingo.commons.api.edm.Edm edm, String resourcePath, java.util.Map<String, String> endpointHttpHeaders, Object data, org.apache.camel.component.olingo4.api.Olingo4ResponseHandler responseHandler);
-void patch(org.apache.olingo.commons.api.edm.Edm edm, String resourcePath, java.util.Map<String, String> endpointHttpHeaders, Object data, org.apache.camel.component.olingo4.api.Olingo4ResponseHandler responseHandler);
-void merge(org.apache.olingo.commons.api.edm.Edm edm, String resourcePath, java.util.Map<String, String> endpointHttpHeaders, Object data, org.apache.camel.component.olingo4.api.Olingo4ResponseHandler responseHandler);
-void batch(org.apache.olingo.commons.api.edm.Edm edm, java.util.Map<String, String> endpointHttpHeaders, Object data, org.apache.camel.component.olingo4.api.Olingo4ResponseHandler responseHandler);
-void action(org.apache.olingo.commons.api.edm.Edm edm, String resourcePath, java.util.Map<String, String> endpointHttpHeaders, Object data, org.apache.camel.component.olingo4.api.Olingo4ResponseHandler responseHandler);