diff --git a/das/das.go b/das/das.go index 75bd413..94462f0 100644 --- a/das/das.go +++ b/das/das.go @@ -323,6 +323,19 @@ func FormUrlCall(dasquery dasql.DASQuery, dasmap mongo.DASRecord) string { if len(vals) < len(skeys) { return "" // number of arguments should be equal or more number of spec key values } + // replace details=True argument in DBS calls + if dasquery.Detail == false { + args = strings.Replace(args, "detail=True", "detail=False", -1) + } + // replace details=True argument in DBS calls + if strings.Contains(args, "detail") { + if v, ok := vals["detail"]; ok { + sv := fmt.Sprintf("%v", v) + if sv == "0" || sv == "false" || sv == "False" { + args = strings.Replace(args, "detail=True", "detail=False", -1) + } + } + } if len(args) > 0 { return base + "?" + args } diff --git a/dasql/dasql.go b/dasql/dasql.go index 6d15085..1ea7900 100644 --- a/dasql/dasql.go +++ b/dasql/dasql.go @@ -365,11 +365,17 @@ func Parse(query, inst string, daskeys []string) (DASQuery, string, string) { } // remove detail from spec - detail := false - if spec["detail"] != nil || len(filters) != 0 { - detail = true - delete(spec, "detail") + // by default detail is set to true for all APIs, to change this I need + // to change das maps and then change it here + detail := true + // if spec["detail"] != nil || len(filters) != 0 { + // detail = true + // delete(spec, "detail") + // } + if spec["detail"] == "-" || spec["detail"] == "false" || spec["detail"] == "False" { + detail = false } + delete(spec, "detail") // find out which system to use var system string