aboutsummaryrefslogtreecommitdiffstats
path: root/feature-healthcheck/src/main/java
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2019-09-13 17:31:46 -0400
committerJim Hahn <jrh3@att.com>2019-09-16 18:24:42 -0400
commit50cd3fbf4561fe445751d299c53efc499df6dfb6 (patch)
tree28d10581129d3b5107693d7183bd2f46af419377 /feature-healthcheck/src/main/java
parent89a8e32aabc34432b3d614f452e10f7125b478ce (diff)
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 <jrh3@att.com>
Diffstat (limited to 'feature-healthcheck/src/main/java')
-rw-r--r--feature-healthcheck/src/main/java/org/onap/policy/drools/healthcheck/RestHealthCheck.java10
1 files changed, 4 insertions, 6 deletions
diff --git a/feature-healthcheck/src/main/java/org/onap/policy/drools/healthcheck/RestHealthCheck.java b/feature-healthcheck/src/main/java/org/onap/policy/drools/healthcheck/RestHealthCheck.java
index 954a2c55..5d9d67ec 100644
--- a/feature-healthcheck/src/main/java/org/onap/policy/drools/healthcheck/RestHealthCheck.java
+++ b/feature-healthcheck/src/main/java/org/onap/policy/drools/healthcheck/RestHealthCheck.java
@@ -31,20 +31,20 @@ 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.healthcheck.HealthCheck.Reports;
@Path("/")
@Api
-@Produces(MediaType.APPLICATION_JSON)
+@Produces({MediaType.APPLICATION_JSON, YamlMessageBodyHandler.APPLICATION_YAML})
@SwaggerDefinition(
info = @Info(
description = "PDP-D Healthcheck Service",
version = "v1.0",
title = "PDP-D Healthcheck"
),
- consumes = {MediaType.APPLICATION_JSON},
- produces = {MediaType.APPLICATION_JSON},
+ consumes = {MediaType.APPLICATION_JSON, YamlMessageBodyHandler.APPLICATION_YAML},
+ produces = {MediaType.APPLICATION_JSON, YamlMessageBodyHandler.APPLICATION_YAML},
schemes = {SwaggerDefinition.Scheme.HTTP},
tags = {
@Tag(name = "pdp-d-healthcheck", description = "Drools PDP Healthcheck Operations")
@@ -54,7 +54,6 @@ public class RestHealthCheck {
@GET
@Path("healthcheck")
- @Produces(MediaType.APPLICATION_JSON)
@ApiOperation(
value = "Perform a system healthcheck",
notes = "Provides healthy status of the PDP-D plus the components defined in its "
@@ -67,7 +66,6 @@ public class RestHealthCheck {
@GET
@Path("healthcheck/configuration")
- @Produces(MediaType.APPLICATION_JSON)
@ApiOperation(
value = "Configuration",
notes = "Provides the Healthcheck server configuration and monitored REST clients",