From ea042c6ca0fc7eb8017012ca56d6879b8cf10637 Mon Sep 17 00:00:00 2001 From: mbohlool Date: Fri, 21 Apr 2017 14:56:01 -0700 Subject: [PATCH] Update go-restful dependency --- Godeps/Godeps.json | 20 ++-- Godeps/LICENSES | 8 +- pkg/api/validation/BUILD | 2 +- pkg/api/validation/schema.go | 2 +- pkg/kubectl/BUILD | 2 +- pkg/kubectl/cmd/testing/BUILD | 2 +- pkg/kubectl/cmd/testing/fake.go | 2 +- pkg/kubectl/cmd/util/BUILD | 4 +- pkg/kubectl/cmd/util/cached_discovery.go | 2 +- pkg/kubectl/cmd/util/cached_discovery_test.go | 2 +- pkg/kubectl/cmd/util/factory.go | 2 +- .../cmd/util/factory_object_mapping.go | 2 +- pkg/kubectl/explain.go | 2 +- .../k8s.io/apimachinery/Godeps/Godeps.json | 4 +- .../src/k8s.io/apiserver/Godeps/Godeps.json | 12 +- staging/src/k8s.io/apiserver/pkg/server/BUILD | 2 +- .../src/k8s.io/apiserver/pkg/server/config.go | 2 +- .../apiserver/pkg/server/genericapiserver.go | 2 +- .../k8s.io/apiserver/pkg/server/routes/BUILD | 2 +- .../apiserver/pkg/server/routes/swagger.go | 2 +- .../src/k8s.io/client-go/Godeps/Godeps.json | 12 +- staging/src/k8s.io/client-go/discovery/BUILD | 4 +- .../client-go/discovery/discovery_client.go | 2 +- .../discovery/discovery_client_test.go | 2 +- .../src/k8s.io/client-go/discovery/fake/BUILD | 2 +- .../client-go/discovery/fake/discovery.go | 2 +- .../client-go/discovery/restmapper_test.go | 2 +- .../k8s.io/kube-aggregator/Godeps/Godeps.json | 12 +- .../Godeps/Godeps.json | 12 +- .../sample-apiserver/Godeps/Godeps.json | 12 +- vendor/BUILD | 1 + .../emicklei/go-restful-swagger12/.travis.yml | 4 + .../swagger => go-restful-swagger12}/BUILD | 5 +- .../CHANGES.md | 3 + .../emicklei/go-restful-swagger12/LICENSE | 22 ++++ .../README.md | 7 ++ .../api_declaration_list.go | 0 .../config.go | 0 .../model_builder.go | 0 .../model_list.go | 0 .../model_property_ext.go | 0 .../model_property_list.go | 0 .../ordered_route_map.go | 0 .../swagger.go | 0 .../swagger_builder.go | 0 .../swagger_webservice.go | 21 ++-- .../go-restful-swagger12/test_package/BUILD | 16 +++ .../emicklei/go-restful/.travis.yml | 6 + vendor/github.com/emicklei/go-restful/BUILD | 1 - .../github.com/emicklei/go-restful/CHANGES.md | 110 +++++++++++++----- .../github.com/emicklei/go-restful/Makefile | 7 ++ .../github.com/emicklei/go-restful/README.md | 24 ++-- .../emicklei/go-restful/compressors.go | 1 + .../emicklei/go-restful/container.go | 21 ++-- vendor/github.com/emicklei/go-restful/doc.go | 2 +- .../github.com/emicklei/go-restful/install.sh | 10 -- .../github.com/emicklei/go-restful/log/log.go | 5 +- .../github.com/emicklei/go-restful/request.go | 23 ---- .../emicklei/go-restful/response.go | 5 +- .../github.com/emicklei/go-restful/route.go | 3 + .../emicklei/go-restful/route_builder.go | 69 +++++++++-- .../emicklei/go-restful/web_service.go | 36 ++++-- 62 files changed, 360 insertions(+), 182 deletions(-) create mode 100644 vendor/github.com/emicklei/go-restful-swagger12/.travis.yml rename vendor/github.com/emicklei/{go-restful/swagger => go-restful-swagger12}/BUILD (87%) rename vendor/github.com/emicklei/{go-restful/swagger => go-restful-swagger12}/CHANGES.md (92%) create mode 100644 vendor/github.com/emicklei/go-restful-swagger12/LICENSE rename vendor/github.com/emicklei/{go-restful/swagger => go-restful-swagger12}/README.md (87%) rename vendor/github.com/emicklei/{go-restful/swagger => go-restful-swagger12}/api_declaration_list.go (100%) rename vendor/github.com/emicklei/{go-restful/swagger => go-restful-swagger12}/config.go (100%) rename vendor/github.com/emicklei/{go-restful/swagger => go-restful-swagger12}/model_builder.go (100%) rename vendor/github.com/emicklei/{go-restful/swagger => go-restful-swagger12}/model_list.go (100%) rename vendor/github.com/emicklei/{go-restful/swagger => go-restful-swagger12}/model_property_ext.go (100%) rename vendor/github.com/emicklei/{go-restful/swagger => go-restful-swagger12}/model_property_list.go (100%) rename vendor/github.com/emicklei/{go-restful/swagger => go-restful-swagger12}/ordered_route_map.go (100%) rename vendor/github.com/emicklei/{go-restful/swagger => go-restful-swagger12}/swagger.go (100%) rename vendor/github.com/emicklei/{go-restful/swagger => go-restful-swagger12}/swagger_builder.go (100%) rename vendor/github.com/emicklei/{go-restful/swagger => go-restful-swagger12}/swagger_webservice.go (96%) create mode 100644 vendor/github.com/emicklei/go-restful-swagger12/test_package/BUILD create mode 100644 vendor/github.com/emicklei/go-restful/.travis.yml create mode 100644 vendor/github.com/emicklei/go-restful/Makefile delete mode 100644 vendor/github.com/emicklei/go-restful/install.sh diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index 9fd565254e..46b0569dc3 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -1,7 +1,7 @@ { "ImportPath": "k8s.io/kubernetes", "GoVersion": "go1.7", - "GodepVersion": "v79", + "GodepVersion": "v74", "Packages": [ "github.com/ugorji/go/codec/codecgen", "github.com/onsi/ginkgo/ginkgo", @@ -980,18 +980,18 @@ }, { "ImportPath": "github.com/emicklei/go-restful", - "Comment": "v1.2-96-g09691a3", - "Rev": "09691a3b6378b740595c1002f40c34dd5f218a22" + "Comment": "2.2.0-4-gff4f55a", + "Rev": "ff4f55a206334ef123e4f79bbf348980da81ca46" + }, + { + "ImportPath": "github.com/emicklei/go-restful-swagger12", + "Comment": "1.0.1", + "Rev": "dcef7f55730566d41eae5db10e7d6981829720f6" }, { "ImportPath": "github.com/emicklei/go-restful/log", - "Comment": "v1.2-96-g09691a3", - "Rev": "09691a3b6378b740595c1002f40c34dd5f218a22" - }, - { - "ImportPath": "github.com/emicklei/go-restful/swagger", - "Comment": "v1.2-96-g09691a3", - "Rev": "09691a3b6378b740595c1002f40c34dd5f218a22" + "Comment": "2.2.0-4-gff4f55a", + "Rev": "ff4f55a206334ef123e4f79bbf348980da81ca46" }, { "ImportPath": "github.com/evanphx/json-patch", diff --git a/Godeps/LICENSES b/Godeps/LICENSES index 1e68fd3ed3..162b28c298 100644 --- a/Godeps/LICENSES +++ b/Godeps/LICENSES @@ -34674,9 +34674,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================================================ -= vendor/github.com/emicklei/go-restful/log licensed under: = += vendor/github.com/emicklei/go-restful-swagger12 licensed under: = -Copyright (c) 2012,2013 Ernest Micklei +Copyright (c) 2017 Ernest Micklei MIT License @@ -34698,12 +34698,12 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -= vendor/github.com/emicklei/go-restful/LICENSE 2ebc1c12a0f4eae5394522e31961e1de - += vendor/github.com/emicklei/go-restful-swagger12/LICENSE b1ce415d97e837c8677d332b274d4f0b - ================================================================================ ================================================================================ -= vendor/github.com/emicklei/go-restful/swagger licensed under: = += vendor/github.com/emicklei/go-restful/log licensed under: = Copyright (c) 2012,2013 Ernest Micklei diff --git a/pkg/api/validation/BUILD b/pkg/api/validation/BUILD index 5d6ebbfb47..c0221f34fd 100644 --- a/pkg/api/validation/BUILD +++ b/pkg/api/validation/BUILD @@ -27,7 +27,7 @@ go_library( "//pkg/capabilities:go_default_library", "//pkg/features:go_default_library", "//pkg/security/apparmor:go_default_library", - "//vendor/github.com/emicklei/go-restful/swagger:go_default_library", + "//vendor/github.com/emicklei/go-restful-swagger12:go_default_library", "//vendor/github.com/exponent-io/jsonpath:go_default_library", "//vendor/github.com/golang/glog:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/equality:go_default_library", diff --git a/pkg/api/validation/schema.go b/pkg/api/validation/schema.go index 635bc39279..c499d537ae 100644 --- a/pkg/api/validation/schema.go +++ b/pkg/api/validation/schema.go @@ -24,7 +24,7 @@ import ( "regexp" "strings" - "github.com/emicklei/go-restful/swagger" + "github.com/emicklei/go-restful-swagger12" ejson "github.com/exponent-io/jsonpath" "github.com/golang/glog" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" diff --git a/pkg/kubectl/BUILD b/pkg/kubectl/BUILD index c2bf133174..1f38ef814d 100644 --- a/pkg/kubectl/BUILD +++ b/pkg/kubectl/BUILD @@ -83,7 +83,7 @@ go_library( "//pkg/printers/internalversion:go_default_library", "//pkg/util:go_default_library", "//pkg/util/slice:go_default_library", - "//vendor/github.com/emicklei/go-restful/swagger:go_default_library", + "//vendor/github.com/emicklei/go-restful-swagger12:go_default_library", "//vendor/github.com/golang/glog:go_default_library", "//vendor/github.com/spf13/cobra:go_default_library", "//vendor/github.com/spf13/pflag:go_default_library", diff --git a/pkg/kubectl/cmd/testing/BUILD b/pkg/kubectl/cmd/testing/BUILD index 0f4c9785b0..4a54db0182 100644 --- a/pkg/kubectl/cmd/testing/BUILD +++ b/pkg/kubectl/cmd/testing/BUILD @@ -23,7 +23,7 @@ go_library( "//pkg/kubectl/plugins:go_default_library", "//pkg/kubectl/resource:go_default_library", "//pkg/printers:go_default_library", - "//vendor/github.com/emicklei/go-restful/swagger:go_default_library", + "//vendor/github.com/emicklei/go-restful-swagger12:go_default_library", "//vendor/github.com/spf13/cobra:go_default_library", "//vendor/github.com/spf13/pflag:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/meta:go_default_library", diff --git a/pkg/kubectl/cmd/testing/fake.go b/pkg/kubectl/cmd/testing/fake.go index 393e7954f7..646c0d1efb 100644 --- a/pkg/kubectl/cmd/testing/fake.go +++ b/pkg/kubectl/cmd/testing/fake.go @@ -23,7 +23,7 @@ import ( "path/filepath" "time" - "github.com/emicklei/go-restful/swagger" + "github.com/emicklei/go-restful-swagger12" "github.com/spf13/cobra" "github.com/spf13/pflag" diff --git a/pkg/kubectl/cmd/util/BUILD b/pkg/kubectl/cmd/util/BUILD index 09a60ce991..87cab2f44e 100644 --- a/pkg/kubectl/cmd/util/BUILD +++ b/pkg/kubectl/cmd/util/BUILD @@ -44,7 +44,7 @@ go_library( "//pkg/printers/internalversion:go_default_library", "//pkg/util/exec:go_default_library", "//pkg/version:go_default_library", - "//vendor/github.com/emicklei/go-restful/swagger:go_default_library", + "//vendor/github.com/emicklei/go-restful-swagger12:go_default_library", "//vendor/github.com/evanphx/json-patch:go_default_library", "//vendor/github.com/go-openapi/spec:go_default_library", "//vendor/github.com/golang/glog:go_default_library", @@ -104,7 +104,7 @@ go_test( "//pkg/kubectl:go_default_library", "//pkg/kubectl/resource:go_default_library", "//pkg/util/exec:go_default_library", - "//vendor/github.com/emicklei/go-restful/swagger:go_default_library", + "//vendor/github.com/emicklei/go-restful-swagger12:go_default_library", "//vendor/github.com/go-openapi/spec:go_default_library", "//vendor/github.com/stretchr/testify/assert:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/equality:go_default_library", diff --git a/pkg/kubectl/cmd/util/cached_discovery.go b/pkg/kubectl/cmd/util/cached_discovery.go index e28af388f6..13633262d8 100644 --- a/pkg/kubectl/cmd/util/cached_discovery.go +++ b/pkg/kubectl/cmd/util/cached_discovery.go @@ -24,7 +24,7 @@ import ( "sync" "time" - "github.com/emicklei/go-restful/swagger" + "github.com/emicklei/go-restful-swagger12" "github.com/go-openapi/spec" "github.com/golang/glog" diff --git a/pkg/kubectl/cmd/util/cached_discovery_test.go b/pkg/kubectl/cmd/util/cached_discovery_test.go index 8b32c697f9..e11e9b4801 100644 --- a/pkg/kubectl/cmd/util/cached_discovery_test.go +++ b/pkg/kubectl/cmd/util/cached_discovery_test.go @@ -22,7 +22,7 @@ import ( "testing" "time" - "github.com/emicklei/go-restful/swagger" + "github.com/emicklei/go-restful-swagger12" "github.com/go-openapi/spec" "github.com/stretchr/testify/assert" diff --git a/pkg/kubectl/cmd/util/factory.go b/pkg/kubectl/cmd/util/factory.go index 5b9dfdd485..23ce0c0434 100644 --- a/pkg/kubectl/cmd/util/factory.go +++ b/pkg/kubectl/cmd/util/factory.go @@ -29,7 +29,7 @@ import ( "strings" "time" - "github.com/emicklei/go-restful/swagger" + "github.com/emicklei/go-restful-swagger12" "github.com/golang/glog" "github.com/spf13/cobra" "github.com/spf13/pflag" diff --git a/pkg/kubectl/cmd/util/factory_object_mapping.go b/pkg/kubectl/cmd/util/factory_object_mapping.go index e9cca1796f..77f160e8ba 100644 --- a/pkg/kubectl/cmd/util/factory_object_mapping.go +++ b/pkg/kubectl/cmd/util/factory_object_mapping.go @@ -27,7 +27,7 @@ import ( "sync" "time" - "github.com/emicklei/go-restful/swagger" + "github.com/emicklei/go-restful-swagger12" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/kubectl/explain.go b/pkg/kubectl/explain.go index 3becdac3f9..6db4074515 100644 --- a/pkg/kubectl/explain.go +++ b/pkg/kubectl/explain.go @@ -21,7 +21,7 @@ import ( "io" "strings" - "github.com/emicklei/go-restful/swagger" + "github.com/emicklei/go-restful-swagger12" "k8s.io/apimachinery/pkg/api/meta" apiutil "k8s.io/kubernetes/pkg/api/util" diff --git a/staging/src/k8s.io/apimachinery/Godeps/Godeps.json b/staging/src/k8s.io/apimachinery/Godeps/Godeps.json index 40437b5077..d5a66354c1 100644 --- a/staging/src/k8s.io/apimachinery/Godeps/Godeps.json +++ b/staging/src/k8s.io/apimachinery/Godeps/Godeps.json @@ -32,11 +32,11 @@ }, { "ImportPath": "github.com/emicklei/go-restful", - "Rev": "09691a3b6378b740595c1002f40c34dd5f218a22" + "Rev": "ff4f55a206334ef123e4f79bbf348980da81ca46" }, { "ImportPath": "github.com/emicklei/go-restful/log", - "Rev": "09691a3b6378b740595c1002f40c34dd5f218a22" + "Rev": "ff4f55a206334ef123e4f79bbf348980da81ca46" }, { "ImportPath": "github.com/evanphx/json-patch", diff --git a/staging/src/k8s.io/apiserver/Godeps/Godeps.json b/staging/src/k8s.io/apiserver/Godeps/Godeps.json index 8724f2d60d..a07ed87e8c 100644 --- a/staging/src/k8s.io/apiserver/Godeps/Godeps.json +++ b/staging/src/k8s.io/apiserver/Godeps/Godeps.json @@ -316,15 +316,15 @@ }, { "ImportPath": "github.com/emicklei/go-restful", - "Rev": "09691a3b6378b740595c1002f40c34dd5f218a22" + "Rev": "ff4f55a206334ef123e4f79bbf348980da81ca46" + }, + { + "ImportPath": "github.com/emicklei/go-restful-swagger12", + "Rev": "dcef7f55730566d41eae5db10e7d6981829720f6" }, { "ImportPath": "github.com/emicklei/go-restful/log", - "Rev": "09691a3b6378b740595c1002f40c34dd5f218a22" - }, - { - "ImportPath": "github.com/emicklei/go-restful/swagger", - "Rev": "09691a3b6378b740595c1002f40c34dd5f218a22" + "Rev": "ff4f55a206334ef123e4f79bbf348980da81ca46" }, { "ImportPath": "github.com/evanphx/json-patch", diff --git a/staging/src/k8s.io/apiserver/pkg/server/BUILD b/staging/src/k8s.io/apiserver/pkg/server/BUILD index 590f47f505..474f68999f 100644 --- a/staging/src/k8s.io/apiserver/pkg/server/BUILD +++ b/staging/src/k8s.io/apiserver/pkg/server/BUILD @@ -55,7 +55,7 @@ go_library( tags = ["automanaged"], deps = [ "//vendor/github.com/coreos/go-systemd/daemon:go_default_library", - "//vendor/github.com/emicklei/go-restful/swagger:go_default_library", + "//vendor/github.com/emicklei/go-restful-swagger12:go_default_library", "//vendor/github.com/go-openapi/spec:go_default_library", "//vendor/github.com/golang/glog:go_default_library", "//vendor/github.com/pborman/uuid:go_default_library", diff --git a/staging/src/k8s.io/apiserver/pkg/server/config.go b/staging/src/k8s.io/apiserver/pkg/server/config.go index a183d2841d..26d5614555 100644 --- a/staging/src/k8s.io/apiserver/pkg/server/config.go +++ b/staging/src/k8s.io/apiserver/pkg/server/config.go @@ -29,7 +29,7 @@ import ( "strings" "time" - "github.com/emicklei/go-restful/swagger" + "github.com/emicklei/go-restful-swagger12" "github.com/go-openapi/spec" "github.com/pborman/uuid" diff --git a/staging/src/k8s.io/apiserver/pkg/server/genericapiserver.go b/staging/src/k8s.io/apiserver/pkg/server/genericapiserver.go index 8f8ead030c..52d5368d63 100644 --- a/staging/src/k8s.io/apiserver/pkg/server/genericapiserver.go +++ b/staging/src/k8s.io/apiserver/pkg/server/genericapiserver.go @@ -25,7 +25,7 @@ import ( "time" systemd "github.com/coreos/go-systemd/daemon" - "github.com/emicklei/go-restful/swagger" + "github.com/emicklei/go-restful-swagger12" "github.com/golang/glog" "k8s.io/apimachinery/pkg/apimachinery" diff --git a/staging/src/k8s.io/apiserver/pkg/server/routes/BUILD b/staging/src/k8s.io/apiserver/pkg/server/routes/BUILD index 38689189b9..2dd8b05bd3 100644 --- a/staging/src/k8s.io/apiserver/pkg/server/routes/BUILD +++ b/staging/src/k8s.io/apiserver/pkg/server/routes/BUILD @@ -23,7 +23,7 @@ go_library( deps = [ "//vendor/github.com/elazarl/go-bindata-assetfs:go_default_library", "//vendor/github.com/emicklei/go-restful:go_default_library", - "//vendor/github.com/emicklei/go-restful/swagger:go_default_library", + "//vendor/github.com/emicklei/go-restful-swagger12:go_default_library", "//vendor/github.com/golang/glog:go_default_library", "//vendor/github.com/prometheus/client_golang/prometheus:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", diff --git a/staging/src/k8s.io/apiserver/pkg/server/routes/swagger.go b/staging/src/k8s.io/apiserver/pkg/server/routes/swagger.go index fb62c65b0f..90f0abf764 100644 --- a/staging/src/k8s.io/apiserver/pkg/server/routes/swagger.go +++ b/staging/src/k8s.io/apiserver/pkg/server/routes/swagger.go @@ -19,7 +19,7 @@ package routes import ( "k8s.io/apiserver/pkg/server/mux" - "github.com/emicklei/go-restful/swagger" + "github.com/emicklei/go-restful-swagger12" ) // Swagger installs the /swaggerapi/ endpoint to allow schema discovery diff --git a/staging/src/k8s.io/client-go/Godeps/Godeps.json b/staging/src/k8s.io/client-go/Godeps/Godeps.json index 11368c68ff..970e9d68d5 100644 --- a/staging/src/k8s.io/client-go/Godeps/Godeps.json +++ b/staging/src/k8s.io/client-go/Godeps/Godeps.json @@ -68,15 +68,15 @@ }, { "ImportPath": "github.com/emicklei/go-restful", - "Rev": "09691a3b6378b740595c1002f40c34dd5f218a22" + "Rev": "ff4f55a206334ef123e4f79bbf348980da81ca46" + }, + { + "ImportPath": "github.com/emicklei/go-restful-swagger12", + "Rev": "dcef7f55730566d41eae5db10e7d6981829720f6" }, { "ImportPath": "github.com/emicklei/go-restful/log", - "Rev": "09691a3b6378b740595c1002f40c34dd5f218a22" - }, - { - "ImportPath": "github.com/emicklei/go-restful/swagger", - "Rev": "09691a3b6378b740595c1002f40c34dd5f218a22" + "Rev": "ff4f55a206334ef123e4f79bbf348980da81ca46" }, { "ImportPath": "github.com/ghodss/yaml", diff --git a/staging/src/k8s.io/client-go/discovery/BUILD b/staging/src/k8s.io/client-go/discovery/BUILD index 9c93c109cd..987e41f87e 100644 --- a/staging/src/k8s.io/client-go/discovery/BUILD +++ b/staging/src/k8s.io/client-go/discovery/BUILD @@ -18,7 +18,7 @@ go_library( ], tags = ["automanaged"], deps = [ - "//vendor/github.com/emicklei/go-restful/swagger:go_default_library", + "//vendor/github.com/emicklei/go-restful-swagger12:go_default_library", "//vendor/github.com/go-openapi/loads:go_default_library", "//vendor/github.com/go-openapi/spec:go_default_library", "//vendor/github.com/golang/glog:go_default_library", @@ -45,7 +45,7 @@ go_test( ], tags = ["automanaged"], deps = [ - "//vendor/github.com/emicklei/go-restful/swagger:go_default_library", + "//vendor/github.com/emicklei/go-restful-swagger12:go_default_library", "//vendor/github.com/go-openapi/spec:go_default_library", "//vendor/github.com/stretchr/testify/assert:go_default_library", "//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library", diff --git a/staging/src/k8s.io/client-go/discovery/discovery_client.go b/staging/src/k8s.io/client-go/discovery/discovery_client.go index aba1c482f1..0ee46b863b 100644 --- a/staging/src/k8s.io/client-go/discovery/discovery_client.go +++ b/staging/src/k8s.io/client-go/discovery/discovery_client.go @@ -23,7 +23,7 @@ import ( "sort" "strings" - "github.com/emicklei/go-restful/swagger" + "github.com/emicklei/go-restful-swagger12" "github.com/go-openapi/loads" "github.com/go-openapi/spec" diff --git a/staging/src/k8s.io/client-go/discovery/discovery_client_test.go b/staging/src/k8s.io/client-go/discovery/discovery_client_test.go index f519ffaf4f..f4058991c3 100644 --- a/staging/src/k8s.io/client-go/discovery/discovery_client_test.go +++ b/staging/src/k8s.io/client-go/discovery/discovery_client_test.go @@ -24,7 +24,7 @@ import ( "reflect" "testing" - "github.com/emicklei/go-restful/swagger" + "github.com/emicklei/go-restful-swagger12" "github.com/go-openapi/spec" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/staging/src/k8s.io/client-go/discovery/fake/BUILD b/staging/src/k8s.io/client-go/discovery/fake/BUILD index c8f646c016..6f894e366d 100644 --- a/staging/src/k8s.io/client-go/discovery/fake/BUILD +++ b/staging/src/k8s.io/client-go/discovery/fake/BUILD @@ -12,7 +12,7 @@ go_library( srcs = ["discovery.go"], tags = ["automanaged"], deps = [ - "//vendor/github.com/emicklei/go-restful/swagger:go_default_library", + "//vendor/github.com/emicklei/go-restful-swagger12:go_default_library", "//vendor/github.com/go-openapi/spec:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", diff --git a/staging/src/k8s.io/client-go/discovery/fake/discovery.go b/staging/src/k8s.io/client-go/discovery/fake/discovery.go index 9a953efccf..eb2be25406 100644 --- a/staging/src/k8s.io/client-go/discovery/fake/discovery.go +++ b/staging/src/k8s.io/client-go/discovery/fake/discovery.go @@ -19,7 +19,7 @@ package fake import ( "fmt" - "github.com/emicklei/go-restful/swagger" + "github.com/emicklei/go-restful-swagger12" "github.com/go-openapi/spec" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/staging/src/k8s.io/client-go/discovery/restmapper_test.go b/staging/src/k8s.io/client-go/discovery/restmapper_test.go index baa16b828f..6bc16ccbf4 100644 --- a/staging/src/k8s.io/client-go/discovery/restmapper_test.go +++ b/staging/src/k8s.io/client-go/discovery/restmapper_test.go @@ -28,7 +28,7 @@ import ( restclient "k8s.io/client-go/rest" "k8s.io/client-go/rest/fake" - "github.com/emicklei/go-restful/swagger" + "github.com/emicklei/go-restful-swagger12" "github.com/go-openapi/spec" "github.com/stretchr/testify/assert" ) diff --git a/staging/src/k8s.io/kube-aggregator/Godeps/Godeps.json b/staging/src/k8s.io/kube-aggregator/Godeps/Godeps.json index 5d802be27d..cd2584a058 100644 --- a/staging/src/k8s.io/kube-aggregator/Godeps/Godeps.json +++ b/staging/src/k8s.io/kube-aggregator/Godeps/Godeps.json @@ -104,15 +104,15 @@ }, { "ImportPath": "github.com/emicklei/go-restful", - "Rev": "09691a3b6378b740595c1002f40c34dd5f218a22" + "Rev": "ff4f55a206334ef123e4f79bbf348980da81ca46" + }, + { + "ImportPath": "github.com/emicklei/go-restful-swagger12", + "Rev": "dcef7f55730566d41eae5db10e7d6981829720f6" }, { "ImportPath": "github.com/emicklei/go-restful/log", - "Rev": "09691a3b6378b740595c1002f40c34dd5f218a22" - }, - { - "ImportPath": "github.com/emicklei/go-restful/swagger", - "Rev": "09691a3b6378b740595c1002f40c34dd5f218a22" + "Rev": "ff4f55a206334ef123e4f79bbf348980da81ca46" }, { "ImportPath": "github.com/evanphx/json-patch", diff --git a/staging/src/k8s.io/kube-apiextensions-server/Godeps/Godeps.json b/staging/src/k8s.io/kube-apiextensions-server/Godeps/Godeps.json index 978222e318..524075acd3 100644 --- a/staging/src/k8s.io/kube-apiextensions-server/Godeps/Godeps.json +++ b/staging/src/k8s.io/kube-apiextensions-server/Godeps/Godeps.json @@ -96,15 +96,15 @@ }, { "ImportPath": "github.com/emicklei/go-restful", - "Rev": "09691a3b6378b740595c1002f40c34dd5f218a22" + "Rev": "ff4f55a206334ef123e4f79bbf348980da81ca46" + }, + { + "ImportPath": "github.com/emicklei/go-restful-swagger12", + "Rev": "dcef7f55730566d41eae5db10e7d6981829720f6" }, { "ImportPath": "github.com/emicklei/go-restful/log", - "Rev": "09691a3b6378b740595c1002f40c34dd5f218a22" - }, - { - "ImportPath": "github.com/emicklei/go-restful/swagger", - "Rev": "09691a3b6378b740595c1002f40c34dd5f218a22" + "Rev": "ff4f55a206334ef123e4f79bbf348980da81ca46" }, { "ImportPath": "github.com/evanphx/json-patch", diff --git a/staging/src/k8s.io/sample-apiserver/Godeps/Godeps.json b/staging/src/k8s.io/sample-apiserver/Godeps/Godeps.json index 6dd1d8b279..0f455305f5 100644 --- a/staging/src/k8s.io/sample-apiserver/Godeps/Godeps.json +++ b/staging/src/k8s.io/sample-apiserver/Godeps/Godeps.json @@ -96,15 +96,15 @@ }, { "ImportPath": "github.com/emicklei/go-restful", - "Rev": "09691a3b6378b740595c1002f40c34dd5f218a22" + "Rev": "ff4f55a206334ef123e4f79bbf348980da81ca46" + }, + { + "ImportPath": "github.com/emicklei/go-restful-swagger12", + "Rev": "dcef7f55730566d41eae5db10e7d6981829720f6" }, { "ImportPath": "github.com/emicklei/go-restful/log", - "Rev": "09691a3b6378b740595c1002f40c34dd5f218a22" - }, - { - "ImportPath": "github.com/emicklei/go-restful/swagger", - "Rev": "09691a3b6378b740595c1002f40c34dd5f218a22" + "Rev": "ff4f55a206334ef123e4f79bbf348980da81ca46" }, { "ImportPath": "github.com/evanphx/json-patch", diff --git a/vendor/BUILD b/vendor/BUILD index d4b0c8896d..33756a5931 100644 --- a/vendor/BUILD +++ b/vendor/BUILD @@ -143,6 +143,7 @@ filegroup( "//vendor/github.com/elazarl/go-bindata-assetfs:all-srcs", "//vendor/github.com/elazarl/goproxy:all-srcs", "//vendor/github.com/emicklei/go-restful:all-srcs", + "//vendor/github.com/emicklei/go-restful-swagger12:all-srcs", "//vendor/github.com/evanphx/json-patch:all-srcs", "//vendor/github.com/exponent-io/jsonpath:all-srcs", "//vendor/github.com/fatih/camelcase:all-srcs", diff --git a/vendor/github.com/emicklei/go-restful-swagger12/.travis.yml b/vendor/github.com/emicklei/go-restful-swagger12/.travis.yml new file mode 100644 index 0000000000..c74e4fa57a --- /dev/null +++ b/vendor/github.com/emicklei/go-restful-swagger12/.travis.yml @@ -0,0 +1,4 @@ +language: go + +go: + - 1.x \ No newline at end of file diff --git a/vendor/github.com/emicklei/go-restful/swagger/BUILD b/vendor/github.com/emicklei/go-restful-swagger12/BUILD similarity index 87% rename from vendor/github.com/emicklei/go-restful/swagger/BUILD rename to vendor/github.com/emicklei/go-restful-swagger12/BUILD index 5e7abc4867..bb3f2209a7 100644 --- a/vendor/github.com/emicklei/go-restful/swagger/BUILD +++ b/vendor/github.com/emicklei/go-restful-swagger12/BUILD @@ -37,6 +37,9 @@ filegroup( filegroup( name = "all-srcs", - srcs = [":package-srcs"], + srcs = [ + ":package-srcs", + "//vendor/github.com/emicklei/go-restful-swagger12/test_package:all-srcs", + ], tags = ["automanaged"], ) diff --git a/vendor/github.com/emicklei/go-restful/swagger/CHANGES.md b/vendor/github.com/emicklei/go-restful-swagger12/CHANGES.md similarity index 92% rename from vendor/github.com/emicklei/go-restful/swagger/CHANGES.md rename to vendor/github.com/emicklei/go-restful-swagger12/CHANGES.md index 736f6f37c5..213b8e7b3c 100644 --- a/vendor/github.com/emicklei/go-restful/swagger/CHANGES.md +++ b/vendor/github.com/emicklei/go-restful-swagger12/CHANGES.md @@ -1,5 +1,8 @@ Change history of swagger = +2017-01-30 +- moved from go-restful/swagger to go-restful-swagger12 + 2015-10-16 - add type override mechanism for swagger models (MR 254, nathanejohnson) - replace uses of wildcard in generated apidocs (issue 251) diff --git a/vendor/github.com/emicklei/go-restful-swagger12/LICENSE b/vendor/github.com/emicklei/go-restful-swagger12/LICENSE new file mode 100644 index 0000000000..aeab5b440e --- /dev/null +++ b/vendor/github.com/emicklei/go-restful-swagger12/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2017 Ernest Micklei + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/vendor/github.com/emicklei/go-restful/swagger/README.md b/vendor/github.com/emicklei/go-restful-swagger12/README.md similarity index 87% rename from vendor/github.com/emicklei/go-restful/swagger/README.md rename to vendor/github.com/emicklei/go-restful-swagger12/README.md index 6c27c30706..cad28966a9 100644 --- a/vendor/github.com/emicklei/go-restful/swagger/README.md +++ b/vendor/github.com/emicklei/go-restful-swagger12/README.md @@ -1,3 +1,8 @@ +# go-restful-swagger12 + +[![Build Status](https://travis-ci.org/emicklei/go-restful-swagger12.png)](https://travis-ci.org/emicklei/go-restful-swagger12) +[![GoDoc](https://godoc.org/github.com/emicklei/go-restful-swagger12?status.svg)](https://godoc.org/github.com/emicklei/go-restful-swagger12) + How to use Swagger UI with go-restful = @@ -74,3 +79,5 @@ Notes -- - The Nickname of an Operation is automatically set by finding the name of the function. You can override it using RouteBuilder.Operation(..) - The WebServices field of swagger.Config can be used to control which service you want to expose and document ; you can have multiple configs and therefore multiple endpoints. + +© 2017, ernestmicklei.com. MIT License. Contributions welcome. \ No newline at end of file diff --git a/vendor/github.com/emicklei/go-restful/swagger/api_declaration_list.go b/vendor/github.com/emicklei/go-restful-swagger12/api_declaration_list.go similarity index 100% rename from vendor/github.com/emicklei/go-restful/swagger/api_declaration_list.go rename to vendor/github.com/emicklei/go-restful-swagger12/api_declaration_list.go diff --git a/vendor/github.com/emicklei/go-restful/swagger/config.go b/vendor/github.com/emicklei/go-restful-swagger12/config.go similarity index 100% rename from vendor/github.com/emicklei/go-restful/swagger/config.go rename to vendor/github.com/emicklei/go-restful-swagger12/config.go diff --git a/vendor/github.com/emicklei/go-restful/swagger/model_builder.go b/vendor/github.com/emicklei/go-restful-swagger12/model_builder.go similarity index 100% rename from vendor/github.com/emicklei/go-restful/swagger/model_builder.go rename to vendor/github.com/emicklei/go-restful-swagger12/model_builder.go diff --git a/vendor/github.com/emicklei/go-restful/swagger/model_list.go b/vendor/github.com/emicklei/go-restful-swagger12/model_list.go similarity index 100% rename from vendor/github.com/emicklei/go-restful/swagger/model_list.go rename to vendor/github.com/emicklei/go-restful-swagger12/model_list.go diff --git a/vendor/github.com/emicklei/go-restful/swagger/model_property_ext.go b/vendor/github.com/emicklei/go-restful-swagger12/model_property_ext.go similarity index 100% rename from vendor/github.com/emicklei/go-restful/swagger/model_property_ext.go rename to vendor/github.com/emicklei/go-restful-swagger12/model_property_ext.go diff --git a/vendor/github.com/emicklei/go-restful/swagger/model_property_list.go b/vendor/github.com/emicklei/go-restful-swagger12/model_property_list.go similarity index 100% rename from vendor/github.com/emicklei/go-restful/swagger/model_property_list.go rename to vendor/github.com/emicklei/go-restful-swagger12/model_property_list.go diff --git a/vendor/github.com/emicklei/go-restful/swagger/ordered_route_map.go b/vendor/github.com/emicklei/go-restful-swagger12/ordered_route_map.go similarity index 100% rename from vendor/github.com/emicklei/go-restful/swagger/ordered_route_map.go rename to vendor/github.com/emicklei/go-restful-swagger12/ordered_route_map.go diff --git a/vendor/github.com/emicklei/go-restful/swagger/swagger.go b/vendor/github.com/emicklei/go-restful-swagger12/swagger.go similarity index 100% rename from vendor/github.com/emicklei/go-restful/swagger/swagger.go rename to vendor/github.com/emicklei/go-restful-swagger12/swagger.go diff --git a/vendor/github.com/emicklei/go-restful/swagger/swagger_builder.go b/vendor/github.com/emicklei/go-restful-swagger12/swagger_builder.go similarity index 100% rename from vendor/github.com/emicklei/go-restful/swagger/swagger_builder.go rename to vendor/github.com/emicklei/go-restful-swagger12/swagger_builder.go diff --git a/vendor/github.com/emicklei/go-restful/swagger/swagger_webservice.go b/vendor/github.com/emicklei/go-restful-swagger12/swagger_webservice.go similarity index 96% rename from vendor/github.com/emicklei/go-restful/swagger/swagger_webservice.go rename to vendor/github.com/emicklei/go-restful-swagger12/swagger_webservice.go index f12b6b1074..d90623120a 100644 --- a/vendor/github.com/emicklei/go-restful/swagger/swagger_webservice.go +++ b/vendor/github.com/emicklei/go-restful-swagger12/swagger_webservice.go @@ -226,6 +226,9 @@ func (sws SwaggerService) composeDeclaration(ws *restful.WebService, pathPrefix pathToRoutes := newOrderedRouteMap() for _, other := range ws.Routes() { if strings.HasPrefix(other.Path, pathPrefix) { + if len(pathPrefix) > 1 && len(other.Path) > len(pathPrefix) && other.Path[len(pathPrefix)] != '/' { + continue + } pathToRoutes.Add(other.Path, other) } } @@ -290,13 +293,12 @@ func composeResponseMessages(route restful.Route, decl *ApiDeclaration, config * if each.Model != nil { st := reflect.TypeOf(each.Model) isCollection, st := detectCollectionType(st) - modelName := modelBuilder{}.keyFrom(st) - if isCollection { - modelName = "array[" + modelName + "]" + // collection cannot be in responsemodel + if !isCollection { + modelName := modelBuilder{}.keyFrom(st) + modelBuilder{Models: &decl.Models, Config: config}.addModel(st, "") + message.ResponseModel = modelName } - modelBuilder{Models: &decl.Models, Config: config}.addModel(st, "") - // reference the model - message.ResponseModel = modelName } messages = append(messages, message) } @@ -331,12 +333,13 @@ func detectCollectionType(st reflect.Type) (bool, reflect.Type) { // addModelFromSample creates and adds (or overwrites) a Model from a sample resource func (sws SwaggerService) addModelFromSampleTo(operation *Operation, isResponse bool, sample interface{}, models *ModelList) { + mb := modelBuilder{Models: models, Config: &sws.config} if isResponse { - type_, items := asDataType(sample, &sws.config) - operation.Type = type_ + sampleType, items := asDataType(sample, &sws.config) + operation.Type = sampleType operation.Items = items } - modelBuilder{Models: models, Config: &sws.config}.addModelFrom(sample) + mb.addModelFrom(sample) } func asSwaggerParameter(param restful.ParameterData) Parameter { diff --git a/vendor/github.com/emicklei/go-restful-swagger12/test_package/BUILD b/vendor/github.com/emicklei/go-restful-swagger12/test_package/BUILD new file mode 100644 index 0000000000..6cc62052ba --- /dev/null +++ b/vendor/github.com/emicklei/go-restful-swagger12/test_package/BUILD @@ -0,0 +1,16 @@ +package(default_visibility = ["//visibility:public"]) + +licenses(["notice"]) + +filegroup( + name = "package-srcs", + srcs = glob(["**"]), + tags = ["automanaged"], + visibility = ["//visibility:private"], +) + +filegroup( + name = "all-srcs", + srcs = [":package-srcs"], + tags = ["automanaged"], +) diff --git a/vendor/github.com/emicklei/go-restful/.travis.yml b/vendor/github.com/emicklei/go-restful/.travis.yml new file mode 100644 index 0000000000..b22f8f547e --- /dev/null +++ b/vendor/github.com/emicklei/go-restful/.travis.yml @@ -0,0 +1,6 @@ +language: go + +go: + - 1.x + +script: go test -v \ No newline at end of file diff --git a/vendor/github.com/emicklei/go-restful/BUILD b/vendor/github.com/emicklei/go-restful/BUILD index 5d7daac201..4717921354 100644 --- a/vendor/github.com/emicklei/go-restful/BUILD +++ b/vendor/github.com/emicklei/go-restful/BUILD @@ -53,7 +53,6 @@ filegroup( srcs = [ ":package-srcs", "//vendor/github.com/emicklei/go-restful/log:all-srcs", - "//vendor/github.com/emicklei/go-restful/swagger:all-srcs", ], tags = ["automanaged"], ) diff --git a/vendor/github.com/emicklei/go-restful/CHANGES.md b/vendor/github.com/emicklei/go-restful/CHANGES.md index 133da800ae..0adca766fb 100644 --- a/vendor/github.com/emicklei/go-restful/CHANGES.md +++ b/vendor/github.com/emicklei/go-restful/CHANGES.md @@ -1,39 +1,71 @@ Change history of go-restful = +2017-02-16 +- solved issue #304, make operation names unique + +2017-01-30 + + [IMPORTANT] For swagger users, change your import statement to: + swagger "github.com/emicklei/go-restful-swagger12" + +- moved swagger 1.2 code to go-restful-swagger12 +- created TAG 2.0.0 + +2017-01-27 + +- remove defer request body close +- expose Dispatch for testing filters and Routefunctions +- swagger response model cannot be array +- created TAG 1.0.0 + +2016-12-22 + +- (API change) Remove code related to caching request content. Removes SetCacheReadEntity(doCache bool) + 2016-11-26 + - Default change! now use CurlyRouter (was RouterJSR311) - Default change! no more caching of request content - Default change! do not recover from panics 2016-09-22 + - fix the DefaultRequestContentType feature 2016-02-14 + - take the qualify factor of the Accept header mediatype into account when deciding the contentype of the response - add constructors for custom entity accessors for xml and json 2015-09-27 + - rename new WriteStatusAnd... to WriteHeaderAnd... for consistency 2015-09-25 + - fixed problem with changing Header after WriteHeader (issue 235) 2015-09-14 + - changed behavior of WriteHeader (immediate write) and WriteEntity (no status write) - added support for custom EntityReaderWriters. 2015-08-06 + - add support for reading entities from compressed request content - use sync.Pool for compressors of http response and request body - add Description to Parameter for documentation in Swagger UI 2015-03-20 + - add configurable logging 2015-03-18 + - if not specified, the Operation is derived from the Route function 2015-03-17 + - expose Parameter creation functions - make trace logger an interface - fix OPTIONSFilter @@ -42,21 +74,26 @@ Change history of go-restful - add Notes to Route 2014-11-27 + - (api add) PrettyPrint per response. (as proposed in #167) 2014-11-12 + - (api add) ApiVersion(.) for documentation in Swagger UI 2014-11-10 + - (api change) struct fields tagged with "description" show up in Swagger UI 2014-10-31 + - (api change) ReturnsError -> Returns - (api add) RouteBuilder.Do(aBuilder) for DRY use of RouteBuilder - fix swagger nested structs - sort Swagger response messages by code 2014-10-23 + - (api add) ReturnsError allows you to document Http codes in swagger - fixed problem with greedy CurlyRouter - (api add) Access-Control-Max-Age in CORS @@ -70,102 +107,117 @@ Change history of go-restful - (api add) ParameterNamed for detailed documentation 2014-04-16 + - (api add) expose constructor of Request for testing. 2014-06-27 + - (api add) ParameterNamed gives access to a Parameter definition and its data (for further specification). - (api add) SetCacheReadEntity allow scontrol over whether or not the request body is being cached (default true for compatibility reasons). 2014-07-03 + - (api add) CORS can be configured with a list of allowed domains 2014-03-12 + - (api add) Route path parameters can use wildcard or regular expressions. (requires CurlyRouter) 2014-02-26 + - (api add) Request now provides information about the matched Route, see method SelectedRoutePath 2014-02-17 + - (api change) renamed parameter constants (go-lint checks) 2014-01-10 - - (api add) support for CloseNotify, see http://golang.org/pkg/net/http/#CloseNotifier + +- (api add) support for CloseNotify, see http://golang.org/pkg/net/http/#CloseNotifier 2014-01-07 - - (api change) Write* methods in Response now return the error or nil. - - added example of serving HTML from a Go template. - - fixed comparing Allowed headers in CORS (is now case-insensitive) + +- (api change) Write* methods in Response now return the error or nil. +- added example of serving HTML from a Go template. +- fixed comparing Allowed headers in CORS (is now case-insensitive) 2013-11-13 - - (api add) Response knows how many bytes are written to the response body. + +- (api add) Response knows how many bytes are written to the response body. 2013-10-29 - - (api add) RecoverHandler(handler RecoverHandleFunction) to change how panic recovery is handled. Default behavior is to log and return a stacktrace. This may be a security issue as it exposes sourcecode information. + +- (api add) RecoverHandler(handler RecoverHandleFunction) to change how panic recovery is handled. Default behavior is to log and return a stacktrace. This may be a security issue as it exposes sourcecode information. 2013-10-04 - - (api add) Response knows what HTTP status has been written - - (api add) Request can have attributes (map of string->interface, also called request-scoped variables + +- (api add) Response knows what HTTP status has been written +- (api add) Request can have attributes (map of string->interface, also called request-scoped variables 2013-09-12 - - (api change) Router interface simplified - - Implemented CurlyRouter, a Router that does not use|allow regular expressions in paths + +- (api change) Router interface simplified +- Implemented CurlyRouter, a Router that does not use|allow regular expressions in paths 2013-08-05 - add OPTIONS support - add CORS support 2013-08-27 - - fixed some reported issues (see github) - - (api change) deprecated use of WriteError; use WriteErrorString instead + +- fixed some reported issues (see github) +- (api change) deprecated use of WriteError; use WriteErrorString instead 2014-04-15 - - (fix) v1.0.1 tag: fix Issue 111: WriteErrorString + +- (fix) v1.0.1 tag: fix Issue 111: WriteErrorString 2013-08-08 - - (api add) Added implementation Container: a WebServices collection with its own http.ServeMux allowing multiple endpoints per program. Existing uses of go-restful will register their services to the DefaultContainer. - - (api add) the swagger package has be extended to have a UI per container. - - if panic is detected then a small stack trace is printed (thanks to runner-mei) - - (api add) WriteErrorString to Response + +- (api add) Added implementation Container: a WebServices collection with its own http.ServeMux allowing multiple endpoints per program. Existing uses of go-restful will register their services to the DefaultContainer. +- (api add) the swagger package has be extended to have a UI per container. +- if panic is detected then a small stack trace is printed (thanks to runner-mei) +- (api add) WriteErrorString to Response Important API changes: - - (api remove) package variable DoNotRecover no longer works ; use restful.DefaultContainer.DoNotRecover(true) instead. - - (api remove) package variable EnableContentEncoding no longer works ; use restful.DefaultContainer.EnableContentEncoding(true) instead. +- (api remove) package variable DoNotRecover no longer works ; use restful.DefaultContainer.DoNotRecover(true) instead. +- (api remove) package variable EnableContentEncoding no longer works ; use restful.DefaultContainer.EnableContentEncoding(true) instead. 2013-07-06 - - (api add) Added support for response encoding (gzip and deflate(zlib)). This feature is disabled on default (for backwards compatibility). Use restful.EnableContentEncoding = true in your initialization to enable this feature. +- (api add) Added support for response encoding (gzip and deflate(zlib)). This feature is disabled on default (for backwards compatibility). Use restful.EnableContentEncoding = true in your initialization to enable this feature. 2013-06-19 - - (improve) DoNotRecover option, moved request body closer, improved ReadEntity +- (improve) DoNotRecover option, moved request body closer, improved ReadEntity 2013-06-03 - - (api change) removed Dispatcher interface, hide PathExpression - - changed receiver names of type functions to be more idiomatic Go +- (api change) removed Dispatcher interface, hide PathExpression +- changed receiver names of type functions to be more idiomatic Go 2013-06-02 - - (optimize) Cache the RegExp compilation of Paths. +- (optimize) Cache the RegExp compilation of Paths. 2013-05-22 - - (api add) Added support for request/response filter functions +- (api add) Added support for request/response filter functions 2013-05-18 - - (api add) Added feature to change the default Http Request Dispatch function (travis cline) - - (api change) Moved Swagger Webservice to swagger package (see example restful-user) +- (api add) Added feature to change the default Http Request Dispatch function (travis cline) +- (api change) Moved Swagger Webservice to swagger package (see example restful-user) [2012-11-14 .. 2013-05-18> - - See https://github.com/emicklei/go-restful/commits +- See https://github.com/emicklei/go-restful/commits 2012-11-14 - - Initial commit +- Initial commit diff --git a/vendor/github.com/emicklei/go-restful/Makefile b/vendor/github.com/emicklei/go-restful/Makefile new file mode 100644 index 0000000000..b40081cc0e --- /dev/null +++ b/vendor/github.com/emicklei/go-restful/Makefile @@ -0,0 +1,7 @@ +all: test + +test: + go test -v . + +ex: + cd examples && ls *.go | xargs go build -o /tmp/ignore \ No newline at end of file diff --git a/vendor/github.com/emicklei/go-restful/README.md b/vendor/github.com/emicklei/go-restful/README.md index cfe6d0a916..cd1f2d0cc2 100644 --- a/vendor/github.com/emicklei/go-restful/README.md +++ b/vendor/github.com/emicklei/go-restful/README.md @@ -1,8 +1,13 @@ go-restful ========== - package for building REST-style Web Services using Google Go +[![Build Status](https://travis-ci.org/emicklei/go-restful.png)](https://travis-ci.org/emicklei/go-restful) +[![Go Report Card](https://goreportcard.com/badge/github.com/emicklei/go-restful)](https://goreportcard.com/report/github.com/emicklei/go-restful) +[![GoDoc](https://godoc.org/github.com/emicklei/go-restful?status.svg)](https://godoc.org/github.com/emicklei/go-restful) + +- [Code examples](https://github.com/emicklei/go-restful/tree/master/examples) + REST asks developers to use HTTP methods explicitly and in a way that's consistent with the protocol definition. This basic REST design principle establishes a one-to-one mapping between create, read, update, and delete (CRUD) operations and HTTP methods. According to this mapping: - GET = Retrieve a representation of a resource @@ -40,35 +45,30 @@ func (u UserResource) findUser(request *restful.Request, response *restful.Respo - Routes for request → function mapping with path parameter (e.g. {id}) support - Configurable router: - - Routing algorithm after [JSR311](http://jsr311.java.net/nonav/releases/1.1/spec/spec.html) that is implemented using (but does **not** accept) regular expressions (See RouterJSR311 which is used by default) - - Fast routing algorithm that allows static elements, regular expressions and dynamic parameters in the URL path (e.g. /meetings/{id} or /static/{subpath:*}, See CurlyRouter) + - (default) Fast routing algorithm that allows static elements, regular expressions and dynamic parameters in the URL path (e.g. /meetings/{id} or /static/{subpath:*} + - Routing algorithm after [JSR311](http://jsr311.java.net/nonav/releases/1.1/spec/spec.html) that is implemented using (but does **not** accept) regular expressions - Request API for reading structs from JSON/XML and accesing parameters (path,query,header) - Response API for writing structs to JSON/XML and setting headers +- Customizable encoding using EntityReaderWriter registration - Filters for intercepting the request → response flow on Service or Route level - Request-scoped variables using attributes - Containers for WebServices on different HTTP endpoints - Content encoding (gzip,deflate) of request and response payloads - Automatic responses on OPTIONS (using a filter) - Automatic CORS request handling (using a filter) -- API declaration for Swagger UI (see swagger package) +- API declaration for Swagger UI (see [go-restful-swagger12](https://github.com/emicklei/go-restful-swagger12),[go-restful-openapi](https://github.com/emicklei/go-restful-openapi)) - Panic recovery to produce HTTP 500, customizable using RecoverHandler(...) - Route errors produce HTTP 404/405/406/415 errors, customizable using ServiceErrorHandler(...) - Configurable (trace) logging -- Customizable encoding using EntityReaderWriter registration - Customizable gzip/deflate readers and writers using CompressorProvider registration ### Resources -- [Documentation on godoc.org](http://godoc.org/github.com/emicklei/go-restful) -- [Code examples](https://github.com/emicklei/go-restful/tree/master/examples) - [Example posted on blog](http://ernestmicklei.com/2012/11/go-restful-first-working-example/) - [Design explained on blog](http://ernestmicklei.com/2012/11/go-restful-api-design/) - [sourcegraph](https://sourcegraph.com/github.com/emicklei/go-restful) -- [gopkg.in](https://gopkg.in/emicklei/go-restful.v1) - [showcase: Mora - MongoDB REST Api server](https://github.com/emicklei/mora) -[![Build Status](https://drone.io/github.com/emicklei/go-restful/status.png)](https://drone.io/github.com/emicklei/go-restful/latest) - -(c) 2012 - 2015, http://ernestmicklei.com. MIT License - Type ```git shortlog -s``` for a full list of contributors. + +© 2012 - 2017, http://ernestmicklei.com. MIT License. Contributions are welcome. \ No newline at end of file diff --git a/vendor/github.com/emicklei/go-restful/compressors.go b/vendor/github.com/emicklei/go-restful/compressors.go index f028456e0f..cb32f7ef53 100644 --- a/vendor/github.com/emicklei/go-restful/compressors.go +++ b/vendor/github.com/emicklei/go-restful/compressors.go @@ -9,6 +9,7 @@ import ( "compress/zlib" ) +// CompressorProvider describes a component that can provider compressors for the std methods. type CompressorProvider interface { // Returns a *gzip.Writer which needs to be released later. // Before using it, call Reset(). diff --git a/vendor/github.com/emicklei/go-restful/container.go b/vendor/github.com/emicklei/go-restful/container.go index 79eb3c4cfa..657d5b6ddd 100644 --- a/vendor/github.com/emicklei/go-restful/container.go +++ b/vendor/github.com/emicklei/go-restful/container.go @@ -32,7 +32,7 @@ type Container struct { contentEncodingEnabled bool // default is false } -// NewContainer creates a new Container using a new ServeMux and default router (RouterJSR311) +// NewContainer creates a new Container using a new ServeMux and default router (CurlyRouter) func NewContainer() *Container { return &Container{ webServices: []*WebService{}, @@ -74,7 +74,7 @@ func (c *Container) DoNotRecover(doNot bool) { c.doNotRecover = doNot } -// Router changes the default Router (currently RouterJSR311) +// Router changes the default Router (currently CurlyRouter) func (c *Container) Router(aRouter RouteSelector) { c.router = aRouter } @@ -188,6 +188,17 @@ func writeServiceError(err ServiceError, req *Request, resp *Response) { resp.WriteErrorString(err.Code, err.Message) } +// Dispatch the incoming Http Request to a matching WebService. +func (c *Container) Dispatch(httpWriter http.ResponseWriter, httpRequest *http.Request) { + if httpWriter == nil { + panic("httpWriter cannot be nil") + } + if httpRequest == nil { + panic("httpRequest cannot be nil") + } + c.dispatch(httpWriter, httpRequest) +} + // Dispatch the incoming Http Request to a matching WebService. func (c *Container) dispatch(httpWriter http.ResponseWriter, httpRequest *http.Request) { writer := httpWriter @@ -208,12 +219,6 @@ func (c *Container) dispatch(httpWriter http.ResponseWriter, httpRequest *http.R } }() } - // Install closing the request body (if any) - defer func() { - if nil != httpRequest.Body { - httpRequest.Body.Close() - } - }() // Detect if compression is needed // assume without compression, test for override diff --git a/vendor/github.com/emicklei/go-restful/doc.go b/vendor/github.com/emicklei/go-restful/doc.go index 21b26ac5a4..f7c16b01fe 100644 --- a/vendor/github.com/emicklei/go-restful/doc.go +++ b/vendor/github.com/emicklei/go-restful/doc.go @@ -1,5 +1,5 @@ /* -Package restful, a lean package for creating REST-style WebServices without magic. +Package restful , a lean package for creating REST-style WebServices without magic. WebServices and Routes diff --git a/vendor/github.com/emicklei/go-restful/install.sh b/vendor/github.com/emicklei/go-restful/install.sh deleted file mode 100644 index 36cbf25f82..0000000000 --- a/vendor/github.com/emicklei/go-restful/install.sh +++ /dev/null @@ -1,10 +0,0 @@ -go test -test.v ...restful && \ -go test -test.v ...swagger && \ -go vet ...restful && \ -go fmt ...swagger && \ -go install ...swagger && \ -go fmt ...restful && \ -go install ...restful -cd examples - ls *.go | xargs -I {} go build -o /tmp/ignore {} - cd .. \ No newline at end of file diff --git a/vendor/github.com/emicklei/go-restful/log/log.go b/vendor/github.com/emicklei/go-restful/log/log.go index f70d89524a..6cd44c7a5d 100644 --- a/vendor/github.com/emicklei/go-restful/log/log.go +++ b/vendor/github.com/emicklei/go-restful/log/log.go @@ -5,7 +5,7 @@ import ( "os" ) -// Logger corresponds to a minimal subset of the interface satisfied by stdlib log.Logger +// StdLogger corresponds to a minimal subset of the interface satisfied by stdlib log.Logger type StdLogger interface { Print(v ...interface{}) Printf(format string, v ...interface{}) @@ -18,14 +18,17 @@ func init() { SetLogger(stdlog.New(os.Stderr, "[restful] ", stdlog.LstdFlags|stdlog.Lshortfile)) } +// SetLogger sets the logger for this package func SetLogger(customLogger StdLogger) { Logger = customLogger } +// Print delegates to the Logger func Print(v ...interface{}) { Logger.Print(v...) } +// Printf delegates to the Logger func Printf(format string, v ...interface{}) { Logger.Printf(format, v...) } diff --git a/vendor/github.com/emicklei/go-restful/request.go b/vendor/github.com/emicklei/go-restful/request.go index 295e6acde3..8c23af12c0 100644 --- a/vendor/github.com/emicklei/go-restful/request.go +++ b/vendor/github.com/emicklei/go-restful/request.go @@ -5,20 +5,15 @@ package restful // that can be found in the LICENSE file. import ( - "bytes" "compress/zlib" - "io/ioutil" "net/http" ) var defaultRequestContentType string -var doCacheReadEntityBytes = false - // Request is a wrapper for a http Request that provides convenience methods type Request struct { Request *http.Request - bodyContent *[]byte // to cache the request body for multiple reads of ReadEntity pathParameters map[string]string attributes map[string]interface{} // for storing request-scoped values selectedRoutePath string // root path + route path that matched the request, e.g. /meetings/{id}/attendees @@ -41,12 +36,6 @@ func DefaultRequestContentType(mime string) { defaultRequestContentType = mime } -// SetCacheReadEntity controls whether the response data ([]byte) is cached such that ReadEntity is repeatable. -// Default is true (due to backwardcompatibility). For better performance, you should set it to false if you don't need it. -func SetCacheReadEntity(doCache bool) { - doCacheReadEntityBytes = doCache -} - // PathParameter accesses the Path parameter value by its name func (r *Request) PathParameter(name string) string { return r.pathParameters[name] @@ -81,18 +70,6 @@ func (r *Request) ReadEntity(entityPointer interface{}) (err error) { contentType := r.Request.Header.Get(HEADER_ContentType) contentEncoding := r.Request.Header.Get(HEADER_ContentEncoding) - // OLD feature, cache the body for reads - if doCacheReadEntityBytes { - if r.bodyContent == nil { - data, err := ioutil.ReadAll(r.Request.Body) - if err != nil { - return err - } - r.bodyContent = &data - } - r.Request.Body = ioutil.NopCloser(bytes.NewReader(*r.bodyContent)) - } - // check if the request body needs decompression if ENCODING_GZIP == contentEncoding { gzipReader := currentCompressorProvider.AcquireGzipReader() diff --git a/vendor/github.com/emicklei/go-restful/response.go b/vendor/github.com/emicklei/go-restful/response.go index 971cd0b42c..3b33ab220a 100644 --- a/vendor/github.com/emicklei/go-restful/response.go +++ b/vendor/github.com/emicklei/go-restful/response.go @@ -9,7 +9,7 @@ import ( "net/http" ) -// DEPRECATED, use DefaultResponseContentType(mime) +// DefaultResponseMimeType is DEPRECATED, use DefaultResponseContentType(mime) var DefaultResponseMimeType string //PrettyPrintResponses controls the indentation feature of XML and JSON serialization @@ -27,11 +27,12 @@ type Response struct { err error // err property is kept when WriteError is called } -// Creates a new response based on a http ResponseWriter. +// NewResponse creates a new response based on a http ResponseWriter. func NewResponse(httpWriter http.ResponseWriter) *Response { return &Response{httpWriter, "", []string{}, http.StatusOK, 0, PrettyPrintResponses, nil} // empty content-types } +// DefaultResponseContentType set a default. // If Accept header matching fails, fall back to this type. // Valid values are restful.MIME_JSON and restful.MIME_XML // Example: diff --git a/vendor/github.com/emicklei/go-restful/route.go b/vendor/github.com/emicklei/go-restful/route.go index f54e8622e3..3dd520eec8 100644 --- a/vendor/github.com/emicklei/go-restful/route.go +++ b/vendor/github.com/emicklei/go-restful/route.go @@ -34,6 +34,9 @@ type Route struct { ParameterDocs []*Parameter ResponseErrors map[int]ResponseError ReadSample, WriteSample interface{} // structs that model an example request or response payload + + // Extra information used to store custom information about the route. + Metadata map[string]interface{} } // Initialize for Route diff --git a/vendor/github.com/emicklei/go-restful/route_builder.go b/vendor/github.com/emicklei/go-restful/route_builder.go index 8bc1ab6846..5ad4a3a7cf 100644 --- a/vendor/github.com/emicklei/go-restful/route_builder.go +++ b/vendor/github.com/emicklei/go-restful/route_builder.go @@ -5,10 +5,12 @@ package restful // that can be found in the LICENSE file. import ( + "fmt" "os" "reflect" "runtime" "strings" + "sync/atomic" "github.com/emicklei/go-restful/log" ) @@ -22,6 +24,9 @@ type RouteBuilder struct { httpMethod string // required function RouteFunction // required filters []FilterFunction + + typeNameHandleFunc TypeNameHandleFunction // required + // documentation doc string notes string @@ -29,6 +34,7 @@ type RouteBuilder struct { readSample, writeSample interface{} parameters []*Parameter errorMap map[int]ResponseError + metadata map[string]interface{} } // Do evaluates each argument with the RouteBuilder itself. @@ -92,8 +98,13 @@ func (b *RouteBuilder) Notes(notes string) *RouteBuilder { // Reads tells what resource type will be read from the request payload. Optional. // A parameter of type "body" is added ,required is set to true and the dataType is set to the qualified name of the sample's type. func (b *RouteBuilder) Reads(sample interface{}) *RouteBuilder { + fn := b.typeNameHandleFunc + if fn == nil { + fn = reflectTypeName + } + typeAsName := fn(sample) + b.readSample = sample - typeAsName := reflect.TypeOf(sample).String() bodyParameter := &Parameter{&ParameterData{Name: "body"}} bodyParameter.beBody() bodyParameter.Required(true) @@ -145,9 +156,10 @@ func (b *RouteBuilder) ReturnsError(code int, message string, model interface{}) // The model parameter is optional ; either pass a struct instance or use nil if not applicable. func (b *RouteBuilder) Returns(code int, message string, model interface{}) *RouteBuilder { err := ResponseError{ - Code: code, - Message: message, - Model: model, + Code: code, + Message: message, + Model: model, + IsDefault: false, } // lazy init because there is no NewRouteBuilder (yet) if b.errorMap == nil { @@ -157,10 +169,36 @@ func (b *RouteBuilder) Returns(code int, message string, model interface{}) *Rou return b } +// DefaultReturns is a special Returns call that sets the default of the response ; the code is zero. +func (b *RouteBuilder) DefaultReturns(message string, model interface{}) *RouteBuilder { + b.Returns(0, message, model) + // Modify the ResponseError just added/updated + re := b.errorMap[0] + // errorMap is initialized + b.errorMap[0] = ResponseError{ + Code: re.Code, + Message: re.Message, + Model: re.Model, + IsDefault: true, + } + return b +} + +// Metadata adds or updates a key=value pair to the metadata map. +func (b *RouteBuilder) Metadata(key string, value interface{}) *RouteBuilder { + if b.metadata == nil { + b.metadata = map[string]interface{}{} + } + b.metadata[key] = value + return b +} + +// ResponseError represents a response; not necessarily an error. type ResponseError struct { - Code int - Message string - Model interface{} + Code int + Message string + Model interface{} + IsDefault bool } func (b *RouteBuilder) servicePath(path string) *RouteBuilder { @@ -186,6 +224,13 @@ func (b *RouteBuilder) copyDefaults(rootProduces, rootConsumes []string) { } } +// typeNameHandler sets the function that will convert types to strings in the parameter +// and model definitions. +func (b *RouteBuilder) typeNameHandler(handler TypeNameHandleFunction) *RouteBuilder { + b.typeNameHandleFunc = handler + return b +} + // Build creates a new Route using the specification details collected by the RouteBuilder func (b *RouteBuilder) Build() Route { pathExpr, err := newPathExpression(b.currentPath) @@ -217,7 +262,8 @@ func (b *RouteBuilder) Build() Route { ParameterDocs: b.parameters, ResponseErrors: b.errorMap, ReadSample: b.readSample, - WriteSample: b.writeSample} + WriteSample: b.writeSample, + Metadata: b.metadata} route.postBuild() return route } @@ -226,6 +272,8 @@ func concatPath(path1, path2 string) string { return strings.TrimRight(path1, "/") + "/" + strings.TrimLeft(path2, "/") } +var anonymousFuncCount int32 + // nameOfFunction returns the short name of the function f for documentation. // It uses a runtime feature for debugging ; its value may change for later Go versions. func nameOfFunction(f interface{}) string { @@ -236,5 +284,10 @@ func nameOfFunction(f interface{}) string { last = strings.TrimSuffix(last, ")-fm") // Go 1.5 last = strings.TrimSuffix(last, "·fm") // < Go 1.5 last = strings.TrimSuffix(last, "-fm") // Go 1.5 + if last == "func1" { // this could mean conflicts in API docs + val := atomic.AddInt32(&anonymousFuncCount, 1) + last = "func" + fmt.Sprintf("%d", val) + atomic.StoreInt32(&anonymousFuncCount, val) + } return last } diff --git a/vendor/github.com/emicklei/go-restful/web_service.go b/vendor/github.com/emicklei/go-restful/web_service.go index 2a51004f80..7af60233a0 100644 --- a/vendor/github.com/emicklei/go-restful/web_service.go +++ b/vendor/github.com/emicklei/go-restful/web_service.go @@ -3,6 +3,7 @@ package restful import ( "errors" "os" + "reflect" "sync" "github.com/emicklei/go-restful/log" @@ -24,6 +25,8 @@ type WebService struct { documentation string apiVersion string + typeNameHandleFunc TypeNameHandleFunction + dynamicRoutes bool // protects 'routes' if dynamic routes are enabled @@ -34,6 +37,25 @@ func (w *WebService) SetDynamicRoutes(enable bool) { w.dynamicRoutes = enable } +// TypeNameHandleFunction declares functions that can handle translating the name of a sample object +// into the restful documentation for the service. +type TypeNameHandleFunction func(sample interface{}) string + +// TypeNameHandler sets the function that will convert types to strings in the parameter +// and model definitions. If not set, the web service will invoke +// reflect.TypeOf(object).String(). +func (w *WebService) TypeNameHandler(handler TypeNameHandleFunction) *WebService { + w.typeNameHandleFunc = handler + return w +} + +// reflectTypeName is the default TypeNameHandleFunction and for a given object +// returns the name that Go identifies it with (e.g. "string" or "v1.Object") via +// the reflection API. +func reflectTypeName(sample interface{}) string { + return reflect.TypeOf(sample).String() +} + // compilePathExpression ensures that the path is compiled into a RegEx for those routers that need it. func (w *WebService) compilePathExpression() { compiled, err := newPathExpression(w.rootPath) @@ -174,7 +196,7 @@ func (w *WebService) RemoveRoute(path, method string) error { // Method creates a new RouteBuilder and initialize its http method func (w *WebService) Method(httpMethod string) *RouteBuilder { - return new(RouteBuilder).servicePath(w.rootPath).Method(httpMethod) + return new(RouteBuilder).typeNameHandler(w.typeNameHandleFunc).servicePath(w.rootPath).Method(httpMethod) } // Produces specifies that this WebService can produce one or more MIME types. @@ -239,30 +261,30 @@ func (w *WebService) Documentation() string { // HEAD is a shortcut for .Method("HEAD").Path(subPath) func (w *WebService) HEAD(subPath string) *RouteBuilder { - return new(RouteBuilder).servicePath(w.rootPath).Method("HEAD").Path(subPath) + return new(RouteBuilder).typeNameHandler(w.typeNameHandleFunc).servicePath(w.rootPath).Method("HEAD").Path(subPath) } // GET is a shortcut for .Method("GET").Path(subPath) func (w *WebService) GET(subPath string) *RouteBuilder { - return new(RouteBuilder).servicePath(w.rootPath).Method("GET").Path(subPath) + return new(RouteBuilder).typeNameHandler(w.typeNameHandleFunc).servicePath(w.rootPath).Method("GET").Path(subPath) } // POST is a shortcut for .Method("POST").Path(subPath) func (w *WebService) POST(subPath string) *RouteBuilder { - return new(RouteBuilder).servicePath(w.rootPath).Method("POST").Path(subPath) + return new(RouteBuilder).typeNameHandler(w.typeNameHandleFunc).servicePath(w.rootPath).Method("POST").Path(subPath) } // PUT is a shortcut for .Method("PUT").Path(subPath) func (w *WebService) PUT(subPath string) *RouteBuilder { - return new(RouteBuilder).servicePath(w.rootPath).Method("PUT").Path(subPath) + return new(RouteBuilder).typeNameHandler(w.typeNameHandleFunc).servicePath(w.rootPath).Method("PUT").Path(subPath) } // PATCH is a shortcut for .Method("PATCH").Path(subPath) func (w *WebService) PATCH(subPath string) *RouteBuilder { - return new(RouteBuilder).servicePath(w.rootPath).Method("PATCH").Path(subPath) + return new(RouteBuilder).typeNameHandler(w.typeNameHandleFunc).servicePath(w.rootPath).Method("PATCH").Path(subPath) } // DELETE is a shortcut for .Method("DELETE").Path(subPath) func (w *WebService) DELETE(subPath string) *RouteBuilder { - return new(RouteBuilder).servicePath(w.rootPath).Method("DELETE").Path(subPath) + return new(RouteBuilder).typeNameHandler(w.typeNameHandleFunc).servicePath(w.rootPath).Method("DELETE").Path(subPath) }