Commit d24a53e3 authored by Mudassar Khan's avatar Mudassar Khan
Browse files

enhance name logic of MEC platform services being published on OCF

parent 7876a2f5
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -446,8 +446,15 @@ func appServicesPOST(w http.ResponseWriter, r *http.Request) {
					port = p
				}
			}
			// Build a unique CAPIF API name: serName + category + sandboxName.
			// Including category avoids collisions when multiple APIs share the same serName
			// (e.g. mep1-mec015-1 registers both MTS and BWM).
			capifApiName := sInfo.SerName + "-" + sandboxName
			if sInfo.SerCategory != nil && sInfo.SerCategory.Name != "" {
				capifApiName = sInfo.SerName + "-" + sInfo.SerCategory.Name + "-" + sandboxName
			}
			apiId, err := capifClient.PublishServiceAPI(
				sInfo.SerName+"-"+sandboxName,
				capifApiName,
				sInfo.Version,
				uri,
				sInfo.SerName,