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:39 UTC

[camel] branch master 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 master
in repository https://gitbox.apache.org/repos/asf/camel.git


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

commit e1eb0f14687865bfa61bf5f162cf7eedcdfb3521
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri Feb 15 09:03:34 2019 +0100

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

diff --git a/core/camel-core/src/main/java/org/apache/camel/model/rest/RestOperationParamDefinition.java b/core/camel-core/src/main/java/org/apache/camel/model/rest/RestOperationParamDefinition.java
index ff28b81..34948d0 100644
--- a/core/camel-core/src/main/java/org/apache/camel/model/rest/RestOperationParamDefinition.java
+++ b/core/camel-core/src/main/java/org/apache/camel/model/rest/RestOperationParamDefinition.java
@@ -19,6 +19,7 @@ package org.apache.camel.model.rest;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
+import java.util.stream.Collectors;
 
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
@@ -303,6 +304,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) {