MCPcopy Index your code
hub / github.com/coder/coder / assertUniqueRoutes

Function assertUniqueRoutes

coderd/coderdtest/swaggerparser.go:230–241  ·  view source on GitHub ↗
(t *testing.T, comments []SwaggerComment)

Source from the content-addressed store, hash-verified

228}
229
230func assertUniqueRoutes(t *testing.T, comments []SwaggerComment) {
231 m := map[string]struct{}{}
232
233 for _, c := range comments {
234 key := c.method + " " + c.router
235 _, alreadyDefined := m[key]
236 assert.False(t, alreadyDefined, "defined route must be unique (method: %s, route: %s)", c.method, c.router)
237 if !alreadyDefined {
238 m[key] = struct{}{}
239 }
240 }
241}
242
243var uniqueAnnotations = []string{"@ID", "@Summary", "@Tags", "@Router"}
244

Callers 1

VerifySwaggerDefinitionsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected