add param parsing methods

related: #41
This commit is contained in:
sentriz
2020-06-06 18:13:45 +01:00
committed by Senan Kelly
parent 07e1c53d69
commit 4f519d71ed
5 changed files with 294 additions and 52 deletions

No files matched your search

+1 -1
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)