From 4e29c1eed57fbcd982c38bd96348b0b183f7820c Mon Sep 17 00:00:00 2001 From: gfraboni Date: Fri, 1 Sep 2017 16:39:10 -0400 Subject: New endpoints to auto populate edge properties. New endpoints created to allow v11 endpoints to have their properties automatically set based on db edge rules. Issue-Id: AAI-60 Change-Id: I9b41f654fa9924b1dcb863aca369725a763b3691 Signed-off-by: gfraboni --- src/main/java/org/openecomp/crud/util/CrudServiceUtil.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/main/java/org/openecomp/crud/util/CrudServiceUtil.java') diff --git a/src/main/java/org/openecomp/crud/util/CrudServiceUtil.java b/src/main/java/org/openecomp/crud/util/CrudServiceUtil.java index 25e3de6..b88f20b 100644 --- a/src/main/java/org/openecomp/crud/util/CrudServiceUtil.java +++ b/src/main/java/org/openecomp/crud/util/CrudServiceUtil.java @@ -41,6 +41,13 @@ public class CrudServiceUtil { } else if (clazz.isAssignableFrom(Double.class)) { return Double.parseDouble(value); } else if (clazz.isAssignableFrom(Boolean.class)) { + + // If the value is an IN/OUT direction, this gets seen as a boolean, so + // check for that first. + if (value.equals("OUT") || value.equals("IN")) { + return value; + } + if (!value.equals("true") && !value.equals("false")) { throw new CrudException("Invalid propertry value: " + value, Status.BAD_REQUEST); } -- cgit 1.2.3-korg