From e20ad8533f92db8c6a078d6535b44dcdb97f237d Mon Sep 17 00:00:00 2001 From: Anthony ESTEBE Date: Wed, 26 Jun 2019 11:08:37 +0700 Subject: [PATCH] add validation of the service struct in the service sdk --- sdk/service/service.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sdk/service/service.go b/sdk/service/service.go index 6fb5e6ac3..2d5e9878a 100644 --- a/sdk/service/service.go +++ b/sdk/service/service.go @@ -78,6 +78,10 @@ func (s *Service) Create(srv *service.Service) (*service.Service, error) { srv.Sid = "_" + srv.Hash.String() } + if err := service.ValidateService(srv); err != nil { + return nil, err + } + return srv, s.serviceDB.Save(srv) }