Commit 752196ee authored by Ikram Haq's avatar Ikram Haq
Browse files

Fix minor issue related to conversion of Service information into json

parent 5f404ae1
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -31,6 +31,15 @@ func convertServiceInfoToJson(obj *ServiceInfo) string {
	return string(jsonInfo)
}

func convertServiceInfoToJson_1(obj *ServiceApiDescription) string {
	jsonInfo, err := json.Marshal(*obj)
	if err != nil {
		log.Error(err.Error())
		return ""
	}
	return string(jsonInfo)
}

func convertJsonToServiceInfo(jsonInfo string) *ServiceInfo {
	var obj ServiceInfo
	err := json.Unmarshal([]byte(jsonInfo), &obj)
+1 −1
Original line number Diff line number Diff line
@@ -408,7 +408,7 @@ func appServicesPOST(w http.ResponseWriter, r *http.Request) {
	// Send response
	w.Header().Set("Location", hostUrl.String()+basePath+"applications/"+appId+"/services/"+sInfo.SerInstanceId)
	w.WriteHeader(http.StatusCreated)
	fmt.Fprint(w, convertServiceInfoToJson(sInfo))
	fmt.Fprint(w, convertServiceInfoToJson_1(dsInfo))
}

func appServicesByIdPUT(w http.ResponseWriter, r *http.Request) {