add param parsing methods

related: #41
This commit is contained in:
sentriz
2020-04-25 17:37:54 +01:00
committed by Senan Kelly
parent 07e1c53d69
commit 4f519d71ed
5 changed files with 296 additions and 54 deletions

View File

@@ -50,7 +50,7 @@ func writeResp(w http.ResponseWriter, r *http.Request, resp *spec.Response) erro
res := metaResponse{Response: resp}
params := r.Context().Value(CtxParams).(params.Params)
ew := &errWriter{w: w}
switch params.Get("f") {
switch v, _ := params.Get("f"); v {
case "json":
w.Header().Set("Content-Type", "application/json")
data, err := json.Marshal(res)