Fix route update procedure

API impact:
  We need to drop default value for type because it brought this type of bugs.
  Starting this patch users should specify route type through CLI or func.yml

Closes: #222
This commit is contained in:
Denis Makogon
2017-08-15 20:39:21 +03:00
parent ab37f2568f
commit d11bafb868
4 changed files with 34 additions and 20 deletions

View File

@@ -110,7 +110,9 @@ func (s *Server) bindAndValidate(c *gin.Context, method string, wroute *models.R
wroute.Route.Path = p
}
wroute.Route.SetDefaults()
if method != http.MethodPatch {
wroute.Route.SetDefaults()
}
return wroute.Validate(method == http.MethodPatch)
}