From cdec05b5e31b704e4ef9dd77d4334821be1efc5a Mon Sep 17 00:00:00 2001 From: Hamid FzM Date: Wed, 16 Aug 2017 14:47:07 +0430 Subject: [PATCH] Generate multipart/form-data consumer for API doc --- generate/swaggergen/g_docs.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/generate/swaggergen/g_docs.go b/generate/swaggergen/g_docs.go index be54679..f6ed2a0 100644 --- a/generate/swaggergen/g_docs.go +++ b/generate/swaggergen/g_docs.go @@ -44,6 +44,7 @@ const ( axml = "application/xml" aplain = "text/plain" ahtml = "text/html" + aform = "multipart/form-data" ) var pkgCache map[string]struct{} //pkg:controller:function:comments comments: key:value @@ -675,6 +676,8 @@ func parserComments(f *ast.FuncDecl, controllerName, pkgpath string) error { case "html": opts.Consumes = append(opts.Consumes, ahtml) opts.Produces = append(opts.Produces, ahtml) + case "form": + opts.Consumes = append(opts.Consumes, aform) } } } else if strings.HasPrefix(t, "@Security") {