From 50cd3fbf4561fe445751d299c53efc499df6dfb6 Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Fri, 13 Sep 2019 17:31:46 -0400 Subject: Add YAML support to drools-pdp rest servlets Drools-pdp depends on some of the GsonJackson annotations that cannot be easily worked around via standard gson. Consequently, this continues to use the JacksonHandler for json-encoding, thus it uses the YamlJacksonHandler for yaml-encoding. Added YAML to swagger "consumes" list. Change-Id: Ic70c68bb274222db571b3515cbf1ab22d9ff2366 Issue-ID: POLICY-2081 Signed-off-by: Jim Hahn --- .../org/onap/policy/drools/server/restful/RestLifecycleManager.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'feature-lifecycle/src') 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 e4a93310..9aea0450 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 @@ -26,6 +26,7 @@ import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; +import org.onap.policy.common.endpoints.http.server.YamlMessageBodyHandler; import org.onap.policy.drools.lifecycle.LifecycleFeature; import org.onap.policy.drools.lifecycle.LifecycleFsm; @@ -34,8 +35,8 @@ import org.onap.policy.drools.lifecycle.LifecycleFsm; */ @Path("/policy/pdp") -@Produces(MediaType.APPLICATION_JSON) -@Consumes(MediaType.APPLICATION_JSON) +@Produces({MediaType.APPLICATION_JSON, YamlMessageBodyHandler.APPLICATION_YAML}) +@Consumes({MediaType.APPLICATION_JSON, YamlMessageBodyHandler.APPLICATION_YAML}) @Api public class RestLifecycleManager { -- cgit 1.2.3-korg