fix swagger handler

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2023-08-14 13:44:57 +03:00
parent 0e19afef86
commit 13cdeb9397
1 changed files with 6 additions and 0 deletions

View File

@ -29,6 +29,12 @@ var Handler = func(dst map[string]interface{}, fsys fs.FS) http.HandlerFunc {
return
}
if dst == nil {
w.WriteHeader(http.StatusOK)
_, _ = w.Write(buf)
return
}
var src interface{}
if err = c.Unmarshal(buf, src); err != nil {