Roll versions after J-Relase (master branch)
[nonrtric/plt/sme.git] / capifcore / internal / publishserviceapi / typevalidation.go
index ad19324..5e8a8fc 100644 (file)
@@ -21,7 +21,6 @@ package publishserviceapi
 
 import (
        "errors"
-       //"fmt"
        "strings"
 )
 
@@ -32,6 +31,9 @@ func (sd ServiceAPIDescription) Validate() error {
        return nil
 }
 
-func (sd ServiceAPIDescription) IsPublished(otherService ServiceAPIDescription) bool {
-       return sd.ApiName == otherService.ApiName
+func (sd ServiceAPIDescription) ValidateAlreadyPublished(otherService ServiceAPIDescription) error {
+       if sd.ApiName == otherService.ApiName {
+               return errors.New("service with identical apiName is already published")
+       }
+       return nil
 }