GoogleCloudPlatform / go-endpoints

Cloud Endpoints for Go
https://go-endpoints.appspot.com
Apache License 2.0
255 stars 56 forks source link

Fields of kind slice, chan, and others cause panic #96

Closed campoy closed 9 years ago

campoy commented 9 years ago

Reported by @kylefinley

Requests with messages contain slices panic. Example:

type TestReq struct {
    Strings []string `json:"strings"`
}

func (s *Service) Test(c context.Context, req *TestReq) error {
    return nil
}
2015/07/29 19:30:21 http: panic serving 127.0.0.1:62097: runtime error: comparing uncomparable type []string
goroutine 6 [running]:
net/http.func·011()
    /private/var/folders/00/0v42r000h01000cxqpysvccm003chb/T/appengine/go_appengine/goroot/src/net/http/server.go:1130 +0xbb
github.com/GoogleCloudPlatform/go-endpoints/endpoints.validateField(0x3697c0, 0xc2080ee840, 0xd7, 0x4dcc60, 0x7, 0x0, 0x0, 0x85aa58, 0x3697c0, 0x5054b0, ...)
    /dev/go/src/github.com/GoogleCloudPlatform/go-endpoints/endpoints/apiconfig.go:773 +0x27e
github.com/GoogleCloudPlatform/go-endpoints/endpoints.validateRequest(0x3633a0, 0xc2080ee840, 0x0, 0x0)
    /dev/go/src/github.com/GoogleCloudPlatform/go-endpoints/endpoints/apiconfig.go:760 +0x438
github.com/GoogleCloudPlatform/go-endpoints/endpoints.(*Server).ServeHTTP(0xc20807ffc0, 0x85c528, 0xc208044d20, 0xc208033520)
    /dev/go/src/github.com/GoogleCloudPlatform/go-endpoints/endpoints/server.go:151 +0x937
net/http.(*ServeMux).ServeHTTP(0xc20803a690, 0x85c528, 0xc208044d20, 0xc208033520)
    /private/var/folders/00/0v42r000h01000cxqpysvccm003chb/T/appengine/go_appengine/goroot/src/net/http/server.go:1541 +0x17d
appengine_internal.handleFilteredHTTP(0x85c528, 0xc208044d20, 0xc208033520)
    /private/var/folders/00/0v42r000h01000cxqpysvccm003chb/T/appengine/go_appengine/goroot/src/appengine_internal/api_dev.go:98 +0x413
net/http.HandlerFunc.ServeHTTP(0x5dc048, 0x85c528, 0xc208044d20, 0xc208033520)
    /private/var/folders/00/0v42r000h01000cxqpysvccm003chb/T/appengine/go_appengine/goroot/src/net/http/server.go:1265 +0x41
net/http.serverHandler.ServeHTTP(0xc2080421e0, 0x85c528, 0xc208044d20, 0xc208033520)
    /private/var/folders/00/0v42r000h01000cxqpysvccm003chb/T/appengine/go_appengine/goroot/src/net/http/server.go:1703 +0x19a
net/http.(*conn).serve(0xc208044c80)
    /private/var/folders/00/0v42r000h01000cxqpysvccm003chb/T/appengine/go_appengine/goroot/src/net/http/server.go:1204 +0xb57
created by net/http.(*Server).Serve
    /private/var/folders/00/0v42r000h01000cxqpysvccm003chb/T/appengine/go_appengine/goroot/src/net/http/server.go:1751 +0x35e
INFO     2015-07-29 19:30:21,200 module.py:809] default: "POST /_ah/spi/Service.Test HTTP/1.1" 500 2399
INFO     2015-07-29 19:30:21,201 module.py:809] default: "PUT /_ah/api/test/v1/test?alt=json HTTP/1.1" 500 2490
INFO     2015-07-29 19:33:02,482 module.py:442] [default] Detected file changes:

Any ideas on what might be causing this. Thanks!