Repository: goadesign/goa
Pull request #2975 (2022-01-10 11:03:07)

Bump github.com/getkin/kin-openapi from 0.87.0 to 0.88.0
Bumps [github.com/getkin/kin-openapi](https://github.com/getkin/kin-openapi) from 0.87.0 to 0.88.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/getkin/kin-openapi/releases">github.com/getkin/kin-openapi's releases</a>.</em></p>
<blockquote>
<h2>v0.88.0</h2>
<h2>What's Changed</h2>
<ul>
<li>extensible-paths by <a href="https://github.com/general-kroll-4-life"><code>@​general-kroll-4-life</code></a> in <a href="https://github-redirect.dependabot.com/getkin/kin-openapi/pull/470">getkin/kin-openapi#470</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/general-kroll-4-life"><code>@​general-kroll-4-life</code></a> made their first contribution in <a href="https://github-redirect.dependabot.com/getkin/kin-openapi/pull/470">getkin/kin-openapi#470</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a href="https://github.com/getkin/kin-openapi/compare/v0.87.0...v0.88.0">https://github.com/getkin/kin-openapi/compare/v0.87.0...v0.88.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/getkin/kin-openapi/commit/c95dd68aef43fa9ac8c1f52f169b387d7681626a"><code>c95dd68</code></a> extensible-paths (<a href="https://github-redirect.dependabot.com/getkin/kin-openapi/issues/470">#470</a>)</li>
<li>See full diff in <a href="https://github.com/getkin/kin-openapi/compare/v0.87.0...v0.88.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=github.com/getkin/kin-openapi&package-manager=go_modules&previous-version=0.87.0&new-version=0.88.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>


Patch:
diff --git a/go.mod b/go.mod
index b10e6d06..0dc06c2e 100644
--- a/go.mod
+++ b/go.mod
@@ -5,7 +5,7 @@ go 1.17
 require (
 	github.com/dimfeld/httppath v0.0.0-20170720192232-ee938bf73598
 	github.com/dimfeld/httptreemux/v5 v5.4.0
-	github.com/getkin/kin-openapi v0.87.0
+	github.com/getkin/kin-openapi v0.88.0
 	github.com/google/gxui v0.0.0-20151028112939-f85e0a97b3a4 // indirect
 	github.com/google/uuid v1.3.0
 	github.com/gorilla/websocket v1.4.2
diff --git a/go.sum b/go.sum
index 2116096a..f5284eb8 100644
--- a/go.sum
+++ b/go.sum
@@ -29,8 +29,8 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.m
 github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ=
 github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0=
 github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
-github.com/getkin/kin-openapi v0.87.0 h1:eeb0WBIgRiXra7ZY0Vo+jWloqvaF2kNEaxAyb+39N+E=
-github.com/getkin/kin-openapi v0.87.0/go.mod h1:660oXbgy5JFMKreazJaQTw7o+X00qeSyhcnluiMv+Xg=
+github.com/getkin/kin-openapi v0.88.0 h1:BjJ2JERWJbYE1o1RGEj/5LmR5qw7ecfl3O3su4ImR+0=
+github.com/getkin/kin-openapi v0.88.0/go.mod h1:660oXbgy5JFMKreazJaQTw7o+X00qeSyhcnluiMv+Xg=
 github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
 github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
 github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY=
diff --git a/http/codegen/server.go b/http/codegen/server.go
index 32680b21..f556fbbb 100644
--- a/http/codegen/server.go
+++ b/http/codegen/server.go
@@ -385,6 +385,11 @@ func {{ .MountServer }}(mux goahttp.Muxer, h *{{ .ServerStruct }}) {
 		{{- end }}
 	{{- end }}
 }
+
+{{ printf "%s configures the mux to serve the %s endpoints." .MountServer .Service.Name | comment }}
+func (s *{{ .ServerStruct }}) {{ .MountServer }}(mux goahttp.Muxer) {
+	{{ .MountServer }}(mux, s)
+}
 `
 
 // input: EndpointData
diff --git a/http/server.go b/http/server.go
index e0453f85..396928e7 100644
--- a/http/server.go
+++ b/http/server.go
@@ -13,6 +13,12 @@ type (
 		Use(func(http.Handler) http.Handler)
 	}
 
+	// Mounter is the interface for servers that allow mounting their endpoints
+	// into a muxer.
+	Mounter interface {
+		Mount(Muxer)
+	}
+
 	// Servers is a list of servers.
 	Servers []Server
 )
@@ -24,6 +30,15 @@ func (s Servers) Use(m func(http.Handler) http.Handler) {
 	}
 }
 
+// Mount will go through all the servers and mount them into the Muxer. It will
+// panic unless all servers satisfy the Mounter interface.
+func (s Servers) Mount(mux Muxer) {
+	for _, v := range s {
+		m := v.(Mounter)
+		m.Mount(mux)
+	}
+}
+
 // Replace returns a handler that serves HTTP requests by replacing the
 // request URL's Path (and RawPath if set) and invoking the handler h.
 // The logic is the same as the standard http package StripPrefix function.


Test patch:
diff --git a/http/codegen/testdata/server_init_functions.go b/http/codegen/testdata/server_init_functions.go
index d2730e03..532054e3 100644
--- a/http/codegen/testdata/server_init_functions.go
+++ b/http/codegen/testdata/server_init_functions.go
@@ -184,6 +184,11 @@ func Mount(mux goahttp.Muxer, h *Server) {
 	MountFileJSON(mux, h.FileJSON)
 	MountPathToFolder(mux, goahttp.Replace("/", "/path/to/folder", h.PathToFolder))
 }
+
+// Mount configures the mux to serve the ServiceFileServer endpoints.
+func (s *Server) Mount(mux goahttp.Muxer) {
+	Mount(mux, s)
+}
 `
 
 var ServerMultipleFilesWithPrefixPathConstructorCode = `// Mount configures the mux to serve the ServiceFileServer endpoints.
@@ -193,6 +198,11 @@ func Mount(mux goahttp.Muxer, h *Server) {
 	MountFileJSON(mux, goahttp.Replace("", "/file.json", h.FileJSON))
 	MountPathToFolder(mux, goahttp.Replace("/server_file_server", "/path/to/folder", h.PathToFolder))
 }
+
+// Mount configures the mux to serve the ServiceFileServer endpoints.
+func (s *Server) Mount(mux goahttp.Muxer) {
+	Mount(mux, s)
+}
 `
 
 var ServerMultipleFilesWithRedirectConstructorCode = `// Mount configures the mux to serve the ServiceFileServer endpoints.
@@ -204,12 +214,22 @@ func Mount(mux goahttp.Muxer, h *Server) {
 	MountFileJSON(mux, h.FileJSON)
 	MountPathToFolder(mux, goahttp.Replace("/", "/path/to/folder", h.PathToFolder))
 }
+
+// Mount configures the mux to serve the ServiceFileServer endpoints.
+func (s *Server) Mount(mux goahttp.Muxer) {
+	Mount(mux, s)
+}
 `
 
 var ServerSimpleRoutingConstructorCode = `// Mount configures the mux to serve the ServiceSimpleRoutingServer endpoints.
 func Mount(mux goahttp.Muxer, h *Server) {
 	MountServerSimpleRoutingHandler(mux, h.ServerSimpleRouting)
 }
+
+// Mount configures the mux to serve the ServiceSimpleRoutingServer endpoints.
+func (s *Server) Mount(mux goahttp.Muxer) {
+	Mount(mux, s)
+}
 `
 
 var ServerMultipleFilesMounterCode = `// MountPathToFolder configures the mux to serve GET request made to "/".