diff options
Diffstat (limited to 'a1-policy-management')
2 files changed, 5 insertions, 2 deletions
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 c18ec81b..13568dbc 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 @@ -190,6 +190,9 @@ public class PolicyController { }) public Mono<ResponseEntity<Object>> putPolicy(@RequestBody PolicyInfo policyInfo) { + if (!policyInfo.validate()) { + return ErrorResponse.createMono("Missing required parameter in body", HttpStatus.BAD_REQUEST); + } String jsonString = gson.toJson(policyInfo.policyData); Ric ric = rics.get(policyInfo.ricId); PolicyType type = policyTypes.get(policyInfo.policyTypeId); @@ -286,7 +289,7 @@ public class PolicyController { @ApiResponse(code = 200, message = "Policies", response = PolicyInfoList.class), @ApiResponse(code = 404, message = "Near-RT RIC, policy type or service not found", response = ErrorResponse.ErrorInfo.class)}) - public ResponseEntity<Object> getPolicies( // + public ResponseEntity<Object> getPolicyInstances( // @ApiParam(name = Consts.POLICY_TYPE_ID_PARAM, required = false, value = "The identity of the policy type to get policies for.") // @RequestParam(name = Consts.POLICY_TYPE_ID_PARAM, required = false) String type, // diff --git a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/PolicyInfo.java b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/PolicyInfo.java index 0ec2165c..594cf786 100644 --- a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/PolicyInfo.java +++ b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/PolicyInfo.java @@ -65,7 +65,7 @@ public class PolicyInfo { @ApiModelProperty(value = "Callback URI for policy status updates", required = false) @JsonProperty(value = "status_notification_uri", required = false) @SerializedName("status_notification_uri") - public String statusNotificationUri; + public String statusNotificationUri = ""; PolicyInfo() {} |