grim/resticide

Fix some bugs that weren't noticed before
develop
2016-07-09, Gary Kramlich
a92197ff1e44
Parents 4420c48b4d7e
Children 39294b4453aa
Fix some bugs that weren't noticed before
--- a/loader/json.go Sat Jul 09 09:38:20 2016 -0500
+++ b/loader/json.go Sat Jul 09 09:53:37 2016 -0500
@@ -35,9 +35,11 @@
return gojsonschema.NewSchema(schema_loader)
}
-func parseRequest(req map[string]interface{}) test.Request {
+func parseRequest(r interface{}) test.Request {
tr := test.Request{}
+ req := r.(map[string]interface{})
+
// path is required
tr.Path = req["path"].(string)
@@ -81,7 +83,7 @@
requests := []test.Request{}
if t["requests"] != nil {
- for _, req := range t["requests"].([]map[string]interface{}) {
+ for _, req := range t["requests"].([]interface{}) {
requests = append(requests, parseRequest(req))
}
} else {