diff --git a/cmd/web/openapi.yml b/cmd/web/openapi.yml index caf20d8..4432175 100644 --- a/cmd/web/openapi.yml +++ b/cmd/web/openapi.yml @@ -103,6 +103,7 @@ paths: tags: - election summary: Get the results of an election + operationId: getElectionResults parameters: - name: id in: path diff --git a/internal/generated.go b/internal/generated.go index d88fba8..659d93f 100644 --- a/internal/generated.go +++ b/internal/generated.go @@ -69,7 +69,7 @@ type ServerInterface interface { CreateElection(w http.ResponseWriter, r *http.Request) // Get the results of an election // (GET /election/{id}/results) - GetElectionIdResults(w http.ResponseWriter, r *http.Request, id int) + GetElectionResults(w http.ResponseWriter, r *http.Request, id int) // Cast your votes for an election // (POST /election/{id}/votes) CreateVotes(w http.ResponseWriter, r *http.Request, id int) @@ -99,8 +99,8 @@ func (siw *ServerInterfaceWrapper) CreateElection(w http.ResponseWriter, r *http handler.ServeHTTP(w, r.WithContext(ctx)) } -// GetElectionIdResults operation middleware -func (siw *ServerInterfaceWrapper) GetElectionIdResults(w http.ResponseWriter, r *http.Request) { +// GetElectionResults operation middleware +func (siw *ServerInterfaceWrapper) GetElectionResults(w http.ResponseWriter, r *http.Request) { ctx := r.Context() var err error @@ -115,7 +115,7 @@ func (siw *ServerInterfaceWrapper) GetElectionIdResults(w http.ResponseWriter, r } handler := http.Handler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - siw.Handler.GetElectionIdResults(w, r, id) + siw.Handler.GetElectionResults(w, r, id) })) for _, middleware := range siw.HandlerMiddlewares { @@ -266,7 +266,7 @@ func HandlerWithOptions(si ServerInterface, options StdHTTPServerOptions) http.H } m.HandleFunc("POST "+options.BaseURL+"/election", wrapper.CreateElection) - m.HandleFunc("GET "+options.BaseURL+"/election/{id}/results", wrapper.GetElectionIdResults) + m.HandleFunc("GET "+options.BaseURL+"/election/{id}/results", wrapper.GetElectionResults) m.HandleFunc("POST "+options.BaseURL+"/election/{id}/votes", wrapper.CreateVotes) return m