Skip to content

Commit

Permalink
Merge pull request #895 from tdakkota/fix/skip-router-if-no-operations
Browse files Browse the repository at this point in the history
fix(gen): do not generate router if there are no operations
  • Loading branch information
ernado authored May 4, 2023
2 parents 7766b89 + 60daa21 commit 4a53143
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gen/_template/router.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{{ template "header" $ }}
{{- $router := $.Router }}

{{- if $.PathsServerEnabled }}
{{- if and $.PathsServerEnabled $.Operations }}
// ServeHTTP serves http request as defined by OpenAPI v3 specification,
// calling handler that matches the path or returning not found error.
func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
Expand Down

0 comments on commit 4a53143

Please sign in to comment.