diff options
Diffstat (limited to 'src/orchestrator/api/generic_placement_intent_handler.go')
-rw-r--r-- | src/orchestrator/api/generic_placement_intent_handler.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/orchestrator/api/generic_placement_intent_handler.go b/src/orchestrator/api/generic_placement_intent_handler.go index 02dbf0be..16f1f234 100644 --- a/src/orchestrator/api/generic_placement_intent_handler.go +++ b/src/orchestrator/api/generic_placement_intent_handler.go @@ -49,8 +49,11 @@ func (h genericPlacementIntentHandler) createGenericPlacementIntentHandler(w htt return } - if g.MetaData.Name == "" { - http.Error(w, "Missing genericPlacementIntentName in POST request", http.StatusBadRequest) + jsonFile := "json-schemas/generic-placement-intent.json" + // Verify JSON Body + err, httpError := validation.ValidateJsonSchemaData(jsonFile, g) + if err != nil { + http.Error(w, err.Error(), httpError) return } |