diff options
Diffstat (limited to 'src/orchestrator/api/controllerhandler.go')
-rw-r--r-- | src/orchestrator/api/controllerhandler.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/orchestrator/api/controllerhandler.go b/src/orchestrator/api/controllerhandler.go index 5df691f3..be300d89 100644 --- a/src/orchestrator/api/controllerhandler.go +++ b/src/orchestrator/api/controllerhandler.go @@ -87,9 +87,11 @@ func (h controllerHandler) createHandler(w http.ResponseWriter, r *http.Request) return } - // Name is required. - if m.Metadata.Name == "" { - http.Error(w, "Missing name in POST request", http.StatusBadRequest) + jsonFile := "json-schemas/controller.json" + // Verify JSON Body + err, httpError := validation.ValidateJsonSchemaData(jsonFile, m) + if err != nil { + http.Error(w, err.Error(), httpError) return } |