X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=capifcore%2Finternal%2Fpublishserviceapi%2Ftypevalidation.go;h=5e8a8fcaa8d259fc80e106566cde461223c933b9;hb=bf6fd321b8147d60a902275e11b41414c35b8514;hp=ad19324abb6a92421ee024efa171ddb36ffc35e2;hpb=c21e101767fbde3a091a0ee7fef7782fedbe5b37;p=nonrtric%2Fplt%2Fsme.git diff --git a/capifcore/internal/publishserviceapi/typevalidation.go b/capifcore/internal/publishserviceapi/typevalidation.go index ad19324..5e8a8fc 100644 --- a/capifcore/internal/publishserviceapi/typevalidation.go +++ b/capifcore/internal/publishserviceapi/typevalidation.go @@ -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 }