summaryrefslogtreecommitdiffstats
path: root/feature-lifecycle/src/main
diff options
context:
space:
mode:
authorjhh <jorge.hernandez-herrero@att.com>2020-11-18 16:40:39 -0600
committerjhh <jorge.hernandez-herrero@att.com>2020-11-18 17:08:33 -0600
commitf01256145bd9abb97cb9fba3019dcaccaeeca509 (patch)
tree47315582744c0b028320f6e3bde87c4cc439f49c /feature-lifecycle/src/main
parent6a429b8504cdd38cadb3ce9bb532d08cc5115da9 (diff)
verify schema validation for any policy type
Issue-ID: POLICY-2880 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: I0cc6e8967d42d347415857dc77976f2b8ab86516 Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Diffstat (limited to 'feature-lifecycle/src/main')
-rw-r--r--feature-lifecycle/src/main/java/org/onap/policy/drools/server/restful/RestLifecycleManager.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/feature-lifecycle/src/main/java/org/onap/policy/drools/server/restful/RestLifecycleManager.java b/feature-lifecycle/src/main/java/org/onap/policy/drools/server/restful/RestLifecycleManager.java
index 957ecfa6..b430533d 100644
--- a/feature-lifecycle/src/main/java/org/onap/policy/drools/server/restful/RestLifecycleManager.java
+++ b/feature-lifecycle/src/main/java/org/onap/policy/drools/server/restful/RestLifecycleManager.java
@@ -286,8 +286,10 @@ public class RestLifecycleManager {
List<ToscaPolicy> policies =
LifecycleFeature.fsm.getPoliciesMap().values().stream().collect(Collectors.toList());
policies.add(toscaPolicy);
- return Response.status(Response.Status.OK)
- .entity(LifecycleFeature.fsm.update(getPolicyUpdate(policies)))
+
+ boolean updateResult = LifecycleFeature.fsm.update(getPolicyUpdate(policies));
+ return Response.status((updateResult ? Response.Status.OK : Response.Status.NOT_ACCEPTABLE))
+ .entity(updateResult)
.build();
}