From 86b3162afffda5b9b8d1c363d6712b0ded1fc1e9 Mon Sep 17 00:00:00 2001 From: astaxie Date: Fri, 19 Aug 2016 00:11:19 +0800 Subject: [PATCH 1/3] fix #1695 update docs --- context/input.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/context/input.go b/context/input.go index 1683060e..1e051784 100644 --- a/context/input.go +++ b/context/input.go @@ -337,7 +337,7 @@ func (input *BeegoInput) Cookie(key string) string { } // Session returns current session item value by a given key. -// if non-existed, return empty string. +// if non-existed, return nil. func (input *BeegoInput) Session(key interface{}) interface{} { return input.CruSession.Get(key) } From 8b525b1aa5d384ef25370b4149f4cf2db25d399b Mon Sep 17 00:00:00 2001 From: astaxie Date: Fri, 19 Aug 2016 00:31:46 +0800 Subject: [PATCH 2/3] fix #1656 --- context/input.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/context/input.go b/context/input.go index 1e051784..fd47c36f 100644 --- a/context/input.go +++ b/context/input.go @@ -344,6 +344,9 @@ func (input *BeegoInput) Session(key interface{}) interface{} { // CopyBody returns the raw request body data as bytes. func (input *BeegoInput) CopyBody(MaxMemory int64) []byte { + if input.Context.Request.Body == nil { + return []byte{} + } safe := &io.LimitedReader{R: input.Context.Request.Body, N: MaxMemory} requestbody, _ := ioutil.ReadAll(safe) input.Context.Request.Body.Close() From efbde1ee77517486eac03e814e01d724ddad18e6 Mon Sep 17 00:00:00 2001 From: astaxie Date: Fri, 19 Aug 2016 23:52:19 +0800 Subject: [PATCH 3/3] add *Item into Schema --- swagger/swagger.go | 1 + 1 file changed, 1 insertion(+) diff --git a/swagger/swagger.go b/swagger/swagger.go index 1060477a..ff04da13 100644 --- a/swagger/swagger.go +++ b/swagger/swagger.go @@ -106,6 +106,7 @@ type Schema struct { Description string `json:"description,omitempty"` Required []string `json:"required,omitempty"` Type string `json:"type,omitempty"` + Items *Propertie `json:"items,omitempty"` Properties map[string]Propertie `json:"properties,omitempty"` }