Skip to content

Commit 82a680d

Browse files
committed
Fix: SwaggerEndpoint
1 parent a07e2ab commit 82a680d

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

cli/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ func Server(vip *viper.Viper, newAPI func(context.Context, *coderd.Options) (*co
679679
}
680680

681681
if cfg.Swagger.Enable.Value {
682-
options.SwaggerEndpointEnable = cfg.Swagger.Enable.Value
682+
options.SwaggerEndpoint = cfg.Swagger.Enable.Value
683683
}
684684

685685
// We use a separate coderAPICloser so the Enterprise API

coderd/coderd.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,11 @@ type Options struct {
102102
RealIPConfig *httpmw.RealIPConfig
103103
TrialGenerator func(ctx context.Context, email string) error
104104
// TLSCertificates is used to mesh DERP servers securely.
105-
TLSCertificates []tls.Certificate
106-
TailnetCoordinator tailnet.Coordinator
107-
DERPServer *derp.Server
108-
DERPMap *tailcfg.DERPMap
109-
SwaggerEndpointEnable bool
105+
TLSCertificates []tls.Certificate
106+
TailnetCoordinator tailnet.Coordinator
107+
DERPServer *derp.Server
108+
DERPMap *tailcfg.DERPMap
109+
SwaggerEndpoint bool
110110

111111
MetricsCacheRefreshInterval time.Duration
112112
AgentStatsRefreshInterval time.Duration
@@ -601,7 +601,7 @@ func New(options *Options) *API {
601601
})
602602
})
603603

604-
if options.SwaggerEndpointEnable {
604+
if options.SwaggerEndpoint {
605605
// Swagger UI requires the URL trailing slash. Otherwise, the browser tries to load /assets
606606
// from http://localhost:8080/assets instead of http://localhost:8080/swagger/assets.
607607
r.Get("/swagger", http.RedirectHandler("/swagger/", http.StatusTemporaryRedirect).ServeHTTP)

coderd/coderd_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ func TestSwagger(t *testing.T) {
138138
t.Parallel()
139139

140140
client := coderdtest.New(t, &coderdtest.Options{
141-
SwaggerEndpointEnabled: true,
141+
SwaggerEndpoint: true,
142142
})
143143

144144
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitMedium)
@@ -157,7 +157,7 @@ func TestSwagger(t *testing.T) {
157157
t.Parallel()
158158

159159
client := coderdtest.New(t, &coderdtest.Options{
160-
SwaggerEndpointEnabled: true,
160+
SwaggerEndpoint: true,
161161
})
162162

163163
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitMedium)

coderd/coderdtest/coderdtest.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ type Options struct {
116116
Database database.Store
117117
Pubsub database.Pubsub
118118

119-
SwaggerEndpointEnabled bool
119+
SwaggerEndpoint bool
120120
}
121121

122122
// New constructs a codersdk client connected to an in-memory API instance.
@@ -299,7 +299,7 @@ func NewOptions(t *testing.T, options *Options) (func(http.Handler), context.Can
299299
AgentStatsRefreshInterval: options.AgentStatsRefreshInterval,
300300
DeploymentConfig: options.DeploymentConfig,
301301
UpdateCheckOptions: options.UpdateCheckOptions,
302-
SwaggerEndpointEnable: options.SwaggerEndpointEnabled,
302+
SwaggerEndpoint: options.SwaggerEndpoint,
303303
}
304304
}
305305

0 commit comments

Comments
 (0)