summaryrefslogtreecommitdiff
path: root/pkg/api/server/register_events.go
diff options
context:
space:
mode:
authorEd Santiago <santiago@redhat.com>2020-02-17 07:23:55 -0700
committerEd Santiago <santiago@redhat.com>2020-02-18 11:07:07 -0700
commit2a411bcbfa3dc72d3a8cb35c2d1004ab05e4e0e8 (patch)
tree9de509509ef6012863bc10415e037aa239cec83c /pkg/api/server/register_events.go
parenta5d55966bde3b0798f9cb89009d443ccfac3126a (diff)
downloadpodman-2a411bcbfa3dc72d3a8cb35c2d1004ab05e4e0e8.tar.gz
podman-2a411bcbfa3dc72d3a8cb35c2d1004ab05e4e0e8.tar.bz2
podman-2a411bcbfa3dc72d3a8cb35c2d1004ab05e4e0e8.zip
Swagger: fix inconsistencies (try #2)
As I've mentioned once or twice, hand-maintained swagger docs are evil. This commit attempts to fix: * Inconsistent methods (swagger says POST but code signature says GET) * Inconsistent capitalization * Typos ("Mounter", "pood") * Completely wrong paths (/inspect vs /json) * Missing .Method() registrations * Missing /libpod in some /volumes paths * Incorrect method declaration: /libpod/containers/.../kill was correct (POST) in swagger but wrong in the code itself (http.MethodGet). Correct the latter to MethodPost This is two hours' work, even with a script I have that tries to cross-check everything. Swagger docs should not be human-maintained. Signed-off-by: Ed Santiago <santiago@redhat.com>
Diffstat (limited to 'pkg/api/server/register_events.go')
-rw-r--r--pkg/api/server/register_events.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/pkg/api/server/register_events.go b/pkg/api/server/register_events.go
index a511725b2..bc3b62662 100644
--- a/pkg/api/server/register_events.go
+++ b/pkg/api/server/register_events.go
@@ -1,6 +1,8 @@
package server
import (
+ "net/http"
+
"github.com/containers/libpod/pkg/api/handlers"
"github.com/gorilla/mux"
)
@@ -32,6 +34,6 @@ func (s *APIServer) registerEventsHandlers(r *mux.Router) error {
// description: returns a string of json data describing an event
// 500:
// "$ref": "#/responses/InternalError"
- r.Handle(VersionedPath("/events"), s.APIHandler(handlers.GetEvents))
+ r.Handle(VersionedPath("/events"), s.APIHandler(handlers.GetEvents)).Methods(http.MethodGet)
return nil
}