Commit f54318c3 authored by hammad zafar's avatar hammad zafar
Browse files

update validation check for ecgi attribute in PredictedQos request

parent fcf95e50
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -574,8 +574,6 @@ func predictedQosPost(w http.ResponseWriter, r *http.Request) {
		return
	}

	responseData := requestData // Both reqesut and response have same data model

	for i, route := range requestData.Routes {
		if route.RouteInfo == nil {
			log.Error("Mandatory routeInfo parameter not present in routes")
@@ -597,9 +595,9 @@ func predictedQosPost(w http.ResponseWriter, r *http.Request) {
				return
			}

			if routeInfo.Location.Ecgi != nil && routeInfo.Location.GeoArea == nil {
				log.Error("Ecgi is not supported in geoArea for MEC Sandbox")
				http.Error(w, "Ecgi is not supported in geoArea for MEC Sandbox", http.StatusBadRequest)
			if routeInfo.Location.Ecgi != nil {
				log.Error("Ecgi is not supported in location for MEC Sandbox")
				http.Error(w, "Ecgi is not supported inside location attribute, only geoArea is supported.", http.StatusBadRequest)
				return
			}

@@ -616,6 +614,8 @@ func predictedQosPost(w http.ResponseWriter, r *http.Request) {
			})
		}

		responseData := requestData // Both request and response have same data model

		var geocoordinatesList gisClient.GeoCoordinateList
		geocoordinatesList.GeoCoordinates = geocoordinates
		powerResp, _, err := gisAppClient.GeospatialDataApi.GetGeoDataPowerValues(context.TODO(), geocoordinatesList)