From 2a411bcbfa3dc72d3a8cb35c2d1004ab05e4e0e8 Mon Sep 17 00:00:00 2001 From: Ed Santiago Date: Mon, 17 Feb 2020 07:23:55 -0700 Subject: 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 --- pkg/api/server/register_exec.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkg/api/server/register_exec.go') diff --git a/pkg/api/server/register_exec.go b/pkg/api/server/register_exec.go index 581f6f79a..ad62de3f5 100644 --- a/pkg/api/server/register_exec.go +++ b/pkg/api/server/register_exec.go @@ -142,7 +142,7 @@ func (s *APIServer) registerExecHandlers(r *mux.Router) error { // 500: // $ref: "#/responses/InternalError" r.Handle(VersionedPath("/exec/{id}/resize"), s.APIHandler(handlers.ResizeExec)).Methods(http.MethodPost) - // swagger:operation GET /exec/{id}/inspect compat inspectExec + // swagger:operation GET /exec/{id}/json compat inspectExec // --- // tags: // - exec (compat) @@ -303,7 +303,7 @@ func (s *APIServer) registerExecHandlers(r *mux.Router) error { // 500: // $ref: "#/responses/InternalError" r.Handle(VersionedPath("/libpod/exec/{id}/resize"), s.APIHandler(handlers.ResizeExec)).Methods(http.MethodPost) - // swagger:operation GET /libpod/exec/{id}/inspect libpod libpodInspectExec + // swagger:operation GET /libpod/exec/{id}/json libpod libpodInspectExec // --- // tags: // - exec -- cgit v1.2.3-54-g00ecf