camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [4/8] camel git commit: added support to exclude a route from documentation
Date Mon, 14 Mar 2016 19:17:48 GMT
added support to exclude a route from documentation


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

Branch: refs/heads/master
Commit: 4748f380ba6f71b591edab5436a26ac27f3dea04
Parents: bcd6b6b
Author: Simion Hantig <simion.hantig@hgdata.com>
Authored: Mon Mar 14 12:10:27 2016 +0200
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Mon Mar 14 19:50:37 2016 +0100

----------------------------------------------------------------------
 .../org/apache/camel/model/rest/RestDefinition.java   |  7 +++++--
 .../org/apache/camel/model/rest/VerbDefinition.java   | 14 +++++++++-----
 .../org/apache/camel/swagger/RestSwaggerReader.java   |  6 ++++--
 3 files changed, 18 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/4748f380/camel-core/src/main/java/org/apache/camel/model/rest/RestDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/rest/RestDefinition.java b/camel-core/src/main/java/org/apache/camel/model/rest/RestDefinition.java
index 7f732a5..2b3baf7 100644
--- a/camel-core/src/main/java/org/apache/camel/model/rest/RestDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/rest/RestDefinition.java
@@ -501,9 +501,12 @@ public class RestDefinition extends OptionalIdentifiedDefinition<RestDefinition>
         return this;
     }
 
-    public RestDefinition excludeFromDocs() {
+    /**
+     * Include or exclude the current Rest Definition in API documentation
+     */
+    public RestDefinition apiDocs(Boolean apiDocs) {
         VerbDefinition verb = getVerbs().get(getVerbs().size() - 1);
-        verb.setExcludeFromDocs(true);
+        verb.setApiDocs(apiDocs);
         return this;
     }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/4748f380/camel-core/src/main/java/org/apache/camel/model/rest/VerbDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/rest/VerbDefinition.java b/camel-core/src/main/java/org/apache/camel/model/rest/VerbDefinition.java
index d3a9aba..2c33f8e 100644
--- a/camel-core/src/main/java/org/apache/camel/model/rest/VerbDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/rest/VerbDefinition.java
@@ -99,7 +99,7 @@ public class VerbDefinition extends OptionalIdentifiedDefinition<VerbDefinition>
     @XmlAttribute
     private String routeId;
     @XmlAttribute
-    private Boolean excludeFromDocs;
+    private Boolean apiDocs;
 
     @Override
     public String getLabel() {
@@ -371,12 +371,16 @@ public class VerbDefinition extends OptionalIdentifiedDefinition<VerbDefinition>
         return rest.verb(verb, uri);
     }
 
-    public Boolean getExcludeFromDocs() {
-        return excludeFromDocs;
+    public Boolean getApiDocs() {
+        return apiDocs;
     }
 
-    public void setExcludeFromDocs(Boolean excludeFromDocs) {
-        this.excludeFromDocs = excludeFromDocs;
+    /**
+     * Whether to include or exclude the VerbDefinition in API documentation.
+     * The default value is true.
+     */
+    public void setApiDocs(Boolean apiDocs) {
+        this.apiDocs = apiDocs;
     }
 
     public String asVerb() {

http://git-wip-us.apache.org/repos/asf/camel/blob/4748f380/components/camel-swagger-java/src/main/java/org/apache/camel/swagger/RestSwaggerReader.java
----------------------------------------------------------------------
diff --git a/components/camel-swagger-java/src/main/java/org/apache/camel/swagger/RestSwaggerReader.java
b/components/camel-swagger-java/src/main/java/org/apache/camel/swagger/RestSwaggerReader.java
index 67f975e..4131c8f 100644
--- a/components/camel-swagger-java/src/main/java/org/apache/camel/swagger/RestSwaggerReader.java
+++ b/components/camel-swagger-java/src/main/java/org/apache/camel/swagger/RestSwaggerReader.java
@@ -117,7 +117,8 @@ public class RestSwaggerReader {
         // gather all types in use
         Set<String> types = new LinkedHashSet<>();
         for (VerbDefinition verb : verbs) {
-            if (verb.getExcludeFromDocs() != null && verb.getExcludeFromDocs()) {
+            // check if the Verb Definition must be excluded from documentation
+            if (verb.getApiDocs() != null && !verb.getApiDocs()) {
                 continue;
             }
             String type = verb.getType();
@@ -164,7 +165,8 @@ public class RestSwaggerReader {
         String basePath = rest.getPath();
 
         for (VerbDefinition verb : verbs) {
-            if (verb.getExcludeFromDocs() != null && verb.getExcludeFromDocs()) {
+            // check if the Verb Definition must be excluded from documentation
+            if (verb.getApiDocs() != null && !verb.getApiDocs()) {
                 continue;
             }
             // the method must be in lower case


Mime
View raw message