From 4dec4dc6aa0b526bb21aedee4b1120d795300978 Mon Sep 17 00:00:00 2001 From: PatrikBuhr Date: Wed, 4 Nov 2020 13:48:27 +0100 Subject: Bugfix path elements containing dot Springboot trunkates last URL path element if it contains a dot '.'. This is a workaround. Change-Id: I1ae4139468a2669bfd6e33ae9eff88b2fc2a2004 Issue-ID: CCSDK-2502 Signed-off-by: PatrikBuhr --- .../controllers/v2/PolicyController.java | 10 +++++----- .../controllers/v2/ServiceController.java | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'a1-policy-management/src/main/java/org') diff --git a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/PolicyController.java b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/PolicyController.java index 256b4782..8dd2df61 100644 --- a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/PolicyController.java +++ b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/PolicyController.java @@ -97,13 +97,13 @@ public class PolicyController { private static Gson gson = new GsonBuilder() // .create(); // - @GetMapping(path = Consts.V2_API_ROOT + "/policy-types/{policyTypeId}", produces = MediaType.APPLICATION_JSON_VALUE) + @GetMapping(path = "/v2/policy-types/{policytype_id:.+}", produces = MediaType.APPLICATION_JSON_VALUE) @ApiOperation(value = "Returns a policy type definition") @ApiResponses(value = { // @ApiResponse(code = 200, message = "Policy type", response = PolicyTypeInfo.class), // - @ApiResponse(code = 404, message = "Near-RT RIC is not found", response = ErrorResponse.ErrorInfo.class)}) + @ApiResponse(code = 404, message = "Policy type is not found", response = ErrorResponse.ErrorInfo.class)}) public ResponseEntity getPolicyType( // - @PathVariable("policyTypeId") String policyTypeId) { + @PathVariable("policytype_id") String policyTypeId) { try { PolicyType type = policyTypes.getType(policyTypeId); PolicyTypeInfo info = new PolicyTypeInfo(type.schema()); @@ -134,7 +134,7 @@ public class PolicyController { } } - @GetMapping(path = Consts.V2_API_ROOT + "/policies/{policy_id}", produces = MediaType.APPLICATION_JSON_VALUE) + @GetMapping(path = Consts.V2_API_ROOT + "/policies/{policy_id:.+}", produces = MediaType.APPLICATION_JSON_VALUE) @ApiOperation(value = "Returns a policy") // @ApiResponses(value = { // @ApiResponse(code = 200, message = "Policy found", response = PolicyInfo.class), // @@ -150,7 +150,7 @@ public class PolicyController { } } - @DeleteMapping(Consts.V2_API_ROOT + "/policies/{policy_id}") + @DeleteMapping(Consts.V2_API_ROOT + "/policies/{policy_id:.+}") @ApiOperation(value = "Delete a policy") @ApiResponses(value = { // @ApiResponse(code = 200, message = "Not used", response = VoidResponse.class), diff --git a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ServiceController.java b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ServiceController.java index b2fa029a..a8fc7e6d 100644 --- a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ServiceController.java +++ b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ServiceController.java @@ -143,9 +143,9 @@ public class ServiceController { @ApiResponse(code = 204, message = "Service unregistered"), @ApiResponse(code = 200, message = "Not used", response = VoidResponse.class), @ApiResponse(code = 404, message = "Service not found", response = ErrorResponse.ErrorInfo.class)}) - @DeleteMapping(Consts.V2_API_ROOT + "/services/{serviceId}") + @DeleteMapping(Consts.V2_API_ROOT + "/services/{service_id:.+}") public ResponseEntity deleteService(// - @PathVariable("serviceId") String serviceId) { + @PathVariable("service_id") String serviceId) { try { Service service = removeService(serviceId); // Remove the policies from the repo and let the consistency monitoring -- cgit 1.2.3-korg