X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=capifcore%2Finternal%2Fpublishserviceapi%2Ftypevalidation.go;h=5e8a8fcaa8d259fc80e106566cde461223c933b9;hb=refs%2Fheads%2Fmaster;hp=ee331adf52b21e7a4eaab1bf6ac16effa1b7084c;hpb=b309fbd569151ca79a6dd20d27cdd02319145499;p=nonrtric%2Fplt%2Fsme.git diff --git a/capifcore/internal/publishserviceapi/typevalidation.go b/capifcore/internal/publishserviceapi/typevalidation.go index ee331ad..5e8a8fc 100644 --- a/capifcore/internal/publishserviceapi/typevalidation.go +++ b/capifcore/internal/publishserviceapi/typevalidation.go @@ -21,7 +21,6 @@ package publishserviceapi import ( "errors" - //"fmt" "strings" ) @@ -31,3 +30,10 @@ func (sd ServiceAPIDescription) Validate() error { } return nil } + +func (sd ServiceAPIDescription) ValidateAlreadyPublished(otherService ServiceAPIDescription) error { + if sd.ApiName == otherService.ApiName { + return errors.New("service with identical apiName is already published") + } + return nil +}