From 63947de885b4736461e8810faaad0ee15899fd8b Mon Sep 17 00:00:00 2001 From: Jozsef Csongvai Date: Fri, 26 Nov 2021 16:19:01 -0500 Subject: Adjust RelatedInstancesValidation to enable child service requests Issue-ID: SO-3811 Signed-off-by: Jozsef Csongvai Change-Id: I135353f99896f1c64529adac1aa2b096388fd6e6 --- .../so/apihandlerinfra/validation/RelatedInstancesValidation.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'mso-api-handlers/mso-api-handler-infra/src/main/java/org') diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/RelatedInstancesValidation.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/RelatedInstancesValidation.java index 3b87d91d3f..801065fdde 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/RelatedInstancesValidation.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/RelatedInstancesValidation.java @@ -185,7 +185,10 @@ public class RelatedInstancesValidation implements ValidationRule { && !(requestScope.equalsIgnoreCase(ModelType.instanceGroup.toString()) && action == Action.createInstance)) { isRelatedServiceInstancePresent = true; - if (!relatedInstance.getInstanceId().equals(sir.getServiceInstanceId())) { + // InstanceDirection.source indicates child service and this validation is for all + // except child services. + if (!InstanceDirection.source.equals(relatedInstance.getInstanceDirection()) + && !relatedInstance.getInstanceId().equals(sir.getServiceInstanceId())) { throw new ValidationException( "serviceInstanceId matching the serviceInstanceId in request URI"); } -- cgit 1.2.3-korg