// ValidateServiceBody validate service request body
ValidateServiceBody validate service request body
// ValidateServiceBody validate service request body
func ValidateServiceBody(c *routing.Context) (service.Service, error) {
	var s service.Service
	err := json.Unmarshal(c.Request.Body(), &s)
	if s.Name == "" || len(s.Hosts) == 0 || s.MatchingURI == "" || s.ToURI == "" || s.APIDocumentation == "" {
		return service.Service{}, errors.New("Missing body parameters")
	}
	if err != nil {
		return service.Service{}, errors.New(`Error parsing body`)
	}
	s.NormalizeService()
	return s, nil
}
func ValidateServiceBody ( c * routing . Context ) ( service . Service , error ) { var s service . Service err := json . Unmarshal ( c . Request . Body ( ) , & s ) if s . Name == " " || len ( s . Hosts ) == 0 || s . MatchingURI == " " || s . ToURI == " " || s . APIDocumentation == " " { return service . Service { } , errors . New ( " " ) } if err != nil { return service . Service { } , errors . New ( `Error parsing body` ) } s . NormalizeService ( ) return s , nil }
ValidateServiceBody validate service request body
ValidateServiceBody validate service request body