summaryrefslogtreecommitdiffstats
path: root/mso-api-handlers/mso-api-handler-infra/src/main/java
diff options
context:
space:
mode:
authorJozsef Csongvai <jozsef.csongvai@bell.ca>2021-11-26 16:19:01 -0500
committerJozsef Csongvai <jozsef.csongvai@bell.ca>2021-11-26 16:52:57 -0500
commit63947de885b4736461e8810faaad0ee15899fd8b (patch)
tree8596a5d16c7e02f17242301e9bc1e76bc57a527e /mso-api-handlers/mso-api-handler-infra/src/main/java
parent4bfbdba3c1c9554b45c2a5c4f221853e7b572577 (diff)
Adjust RelatedInstancesValidation to enable child service requests
Issue-ID: SO-3811 Signed-off-by: Jozsef Csongvai <jozsef.csongvai@bell.ca> Change-Id: I135353f99896f1c64529adac1aa2b096388fd6e6
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.java5
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");
}