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

Function WithSwaggerRoutePrefix

coderd/coderdtest/swaggerparser.go:161–165  ·  view source on GitHub ↗

WithSwaggerRoutePrefix prepends the given prefix to every route walked from the chi router. Use this when calling VerifySwaggerDefinitions with a subrouter (for example api.APIHandler at /api/v2) so that routes line up with the absolute paths used in @Router annotations.

(prefix string)

Source from the content-addressed store, hash-verified

159// subrouter (for example api.APIHandler at /api/v2) so that routes line up
160// with the absolute paths used in @Router annotations.
161func WithSwaggerRoutePrefix(prefix string) SwaggerOption {
162 return func(o *swaggerOptions) {
163 o.routePrefix = prefix
164 }
165}
166
167func isExperimentalEndpoint(route string) bool {
168 return strings.HasPrefix(route, "/api/v2/workspaceagents/me/experimental/")

Callers 2

TestEndpointsDocumentedFunction · 0.92

Calls

no outgoing calls

Tested by 2

TestEndpointsDocumentedFunction · 0.74