X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=capifcore%2Finternal%2Fdiscoverservice%2Fdiscoverservice.go;h=511dbe0415dbb718d844db2928b5d5f67eee0727;hb=cf1b587eba848c3500c4ffa020d1665f3fc7021f;hp=797eaa7cf2e4f126135b918694118721e40bf9e0;hpb=d0199885b0bc379f22dbb7012545f0049f979bac;p=nonrtric%2Fplt%2Fsme.git diff --git a/capifcore/internal/discoverservice/discoverservice.go b/capifcore/internal/discoverservice/discoverservice.go index 797eaa7..511dbe0 100644 --- a/capifcore/internal/discoverservice/discoverservice.go +++ b/capifcore/internal/discoverservice/discoverservice.go @@ -21,6 +21,7 @@ package discoverservice import ( + "fmt" "net/http" "oransc.org/nonrtric/capifcore/internal/common29122" @@ -45,7 +46,7 @@ func NewDiscoverService(invokerRegister invokermanagement.InvokerRegister) *Disc func (ds *DiscoverService) GetAllServiceAPIs(ctx echo.Context, params discoverapi.GetAllServiceAPIsParams) error { allApis := ds.invokerRegister.GetInvokerApiList(params.ApiInvokerId) if allApis == nil { - return sendCoreError(ctx, http.StatusNotFound, "Invoker not registered") + return sendCoreError(ctx, http.StatusNotFound, fmt.Sprintf("Invoker %s not registered", params.ApiInvokerId)) } filteredApis := []publishapi.ServiceAPIDescription{} gatewayDomain := "r1-expo-func-aef" @@ -141,18 +142,12 @@ func checkVersion(version publishapi.Version, wantedVersion *string, commType *p } func checkCommType(resources *[]publishapi.Resource, commType *publishapi.CommunicationType) bool { - match := false - if commType != nil { - for _, resource := range *resources { - if resource.CommType == *commType { - match = true - break - } + for _, resource := range *resources { + if resource.CommType == *commType { + return true } - } else { - match = true } - return match + return false } // This function wraps sending of an error in the Error format, and