diff options
author | Eric Multanen <eric.w.multanen@intel.com> | 2020-08-21 00:11:26 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-08-21 00:11:26 +0000 |
commit | 38ed3fbf85636ad5f73538c2de07cce72499f5bf (patch) | |
tree | 0b0df9525e67e0180c00abaa078d07fc9b5d9e08 /src/orchestrator/api/app_intent_handler.go | |
parent | a5ffa8aadf49bb92371f06797b264e0bf4c264e2 (diff) | |
parent | 6fc3a329aba55dfa2d4867bde9d8a3126b45f59a (diff) |
Merge "Add Validation for API's"
Diffstat (limited to 'src/orchestrator/api/app_intent_handler.go')
-rw-r--r-- | src/orchestrator/api/app_intent_handler.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/orchestrator/api/app_intent_handler.go b/src/orchestrator/api/app_intent_handler.go index 56811d2d..a51b9b92 100644 --- a/src/orchestrator/api/app_intent_handler.go +++ b/src/orchestrator/api/app_intent_handler.go @@ -48,8 +48,11 @@ func (h appIntentHandler) createAppIntentHandler(w http.ResponseWriter, r *http. return } - if a.MetaData.Name == "" { - http.Error(w, "Missing AppIntentName in POST request", http.StatusBadRequest) + jsonFile := "json-schemas/generic-placement-intent-app.json" + // Verify JSON Body + err, httpError := validation.ValidateJsonSchemaData(jsonFile, a) + if err != nil { + http.Error(w, err.Error(), httpError) return } |