summaryrefslogtreecommitdiffstats
path: root/configserver
diff options
context:
space:
mode:
authorBjørn Christian Seime <bjorncs@verizonmedia.com>2021-03-25 17:01:14 +0100
committerBjørn Christian Seime <bjorncs@verizonmedia.com>2021-03-26 13:49:39 +0100
commitc58704ff3dd6b204c4df28499e418bb8e77f72d2 (patch)
tree2bfab01b11d442b1aa37611c365f2c00fed7cced /configserver
parenta9c2fe028dbec15644923a9de800320c15b90579 (diff)
Optional inject request entity to handler for POST,PUT,PATCH
Diffstat (limited to 'configserver')
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/serviceview/StateRequestHandler.java5
1 files changed, 2 insertions, 3 deletions
diff --git a/configserver/src/main/java/com/yahoo/vespa/serviceview/StateRequestHandler.java b/configserver/src/main/java/com/yahoo/vespa/serviceview/StateRequestHandler.java
index 4fbb001b880..06f3ba56c0c 100644
--- a/configserver/src/main/java/com/yahoo/vespa/serviceview/StateRequestHandler.java
+++ b/configserver/src/main/java/com/yahoo/vespa/serviceview/StateRequestHandler.java
@@ -4,7 +4,6 @@ package com.yahoo.vespa.serviceview;
import com.google.inject.Inject;
import com.yahoo.cloud.config.ConfigserverConfig;
import com.yahoo.container.jdisc.LoggingRequestHandler;
-import com.yahoo.restapi.JacksonJsonResponse;
import com.yahoo.restapi.RestApi;
import com.yahoo.restapi.RestApiRequestHandler;
import com.yahoo.vespa.serviceview.bindings.ApplicationView;
@@ -79,8 +78,8 @@ public class StateRequestHandler extends RestApiRequestHandler<StateRequestHandl
.get(self::getUserInfo))
.addRoute(RestApi.route("/serviceview/v1/tenant/{tenantName}/application/{applicationName}/environment/{environmentName}/region/{regionName}/instance/{instanceName}/service/{serviceIdentifier}/{*}")
.get(self::singleService))
- .addResponseMapper(HashMap.class, (hashMap, context) -> new JacksonJsonResponse<>(200, hashMap, true))
- .addResponseMapper(ApplicationView.class, (applicationView, context) -> new JacksonJsonResponse<>(200, applicationView, true))
+ .registerJacksonResponseEntity(HashMap.class)
+ .registerJacksonResponseEntity(ApplicationView.class)
.build();
}