diff options
Diffstat (limited to 'mso-api-handlers/mso-api-handler-infra/src/main/java')
-rw-r--r-- | mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/RelatedInstancesValidation.java | 5 |
1 files changed, 4 insertions, 1 deletions
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"); } |