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 2019/02/15 08:06:40 UTC

[camel] branch camel-2.23.x updated: CAMEL-13171: Fixed issue with camel-restdsl-swagger generation not able to set allowed values.

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

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


The following commit(s) were added to refs/heads/camel-2.23.x by this push:
     new ae6e788  CAMEL-13171: Fixed issue with camel-restdsl-swagger generation not able to set allowed values.
ae6e788 is described below

commit ae6e7887aadc460dafcd9914cbb2e0048bb17b85
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri Feb 15 09:05:32 2019 +0100

    CAMEL-13171: Fixed issue with camel-restdsl-swagger generation not able to set allowed values.
---
 .../org/apache/camel/model/rest/RestOperationParamDefinition.java | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/camel-core/src/main/java/org/apache/camel/model/rest/RestOperationParamDefinition.java b/camel-core/src/main/java/org/apache/camel/model/rest/RestOperationParamDefinition.java
index d528a77..821460d 100644
--- a/camel-core/src/main/java/org/apache/camel/model/rest/RestOperationParamDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/rest/RestOperationParamDefinition.java
@@ -327,6 +327,14 @@ public class RestOperationParamDefinition {
     }
 
     /**
+     * Allowed values of the parameter when its an enum type
+     */
+    public RestOperationParamDefinition allowableValues(String allowableValues) {
+        setAllowableValues(Arrays.asList(allowableValues.split(",")));
+        return this;
+    }
+
+    /**
      * The parameter type such as body, form, header, path, query
      */
     public RestOperationParamDefinition type(RestParamType type) {