Skip to content

Commit ebf2e9e

Browse files
committed
Fix: Swagger.Enable
1 parent 18effcd commit ebf2e9e

File tree

8 files changed

+10
-10
lines changed

8 files changed

+10
-10
lines changed

cli/deployment/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ func newConfig() *codersdk.DeploymentConfig {
431431
Default: 24 * 30 * time.Hour,
432432
},
433433
Swagger: &codersdk.SwaggerConfig{
434-
Enabled: &codersdk.DeploymentConfigField[bool]{
434+
Enable: &codersdk.DeploymentConfigField[bool]{
435435
Name: "Enable swagger endpoint",
436436
Usage: "Expose the swagger endpoint via /swagger.",
437437
Flag: "swagger-enabled",

cli/server.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -610,8 +610,8 @@ func Server(vip *viper.Viper, newAPI func(context.Context, *coderd.Options) (*co
610610
), cfg.Prometheus.Address.Value, "prometheus")()
611611
}
612612

613-
if cfg.Swagger.Enabled.Value {
614-
options.SwaggerEndpointEnabled = cfg.Swagger.Enabled.Value
613+
if cfg.Swagger.Enable.Value {
614+
options.SwaggerEndpointEnable = cfg.Swagger.Enable.Value
615615
}
616616

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

cli/testdata/coder_server_--help.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ Flags:
169169
Consumes $CODER_SSH_KEYGEN_ALGORITHM
170170
(default "ed25519")
171171
--swagger-enabled Expose the swagger endpoint via /swagger.
172-
Consumes $CODER_SWAGGER_ENABLED
172+
Consumes $CODER_SWAGGER_ENABLE
173173
--telemetry Whether telemetry is enabled or not.
174174
Coder collects anonymized usage data to
175175
help improve our product.

coderd/coderd.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ type Options struct {
112112
DeploymentConfig *codersdk.DeploymentConfig
113113
UpdateCheckOptions *updatecheck.Options // Set non-nil to enable update checking.
114114

115-
SwaggerEndpointEnabled bool
115+
SwaggerEndpointEnable bool
116116

117117
HTTPClient *http.Client
118118
}
@@ -601,7 +601,7 @@ func New(options *Options) *API {
601601
})
602602
})
603603

604-
if options.SwaggerEndpointEnabled {
604+
if options.SwaggerEndpointEnable {
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.StatusSeeOther).ServeHTTP)

coderd/coderdtest/coderdtest.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ func NewOptions(t *testing.T, options *Options) (func(http.Handler), context.Can
290290
AgentStatsRefreshInterval: options.AgentStatsRefreshInterval,
291291
DeploymentConfig: options.DeploymentConfig,
292292
UpdateCheckOptions: options.UpdateCheckOptions,
293-
SwaggerEndpointEnabled: options.SwaggerEndpointEnabled,
293+
SwaggerEndpointEnable: options.SwaggerEndpointEnabled,
294294
}
295295
}
296296

codersdk/deploymentconfig.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ type ProvisionerConfig struct {
143143
}
144144

145145
type SwaggerConfig struct {
146-
Enabled *DeploymentConfigField[bool] `json:"enabled" typescript:",notnull"`
146+
Enable *DeploymentConfigField[bool] `json:"enable" typescript:",notnull"`
147147
}
148148

149149
type Flaggable interface {

scripts/develop.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ fatal() {
121121
trap 'fatal "Script encountered an error"' ERR
122122

123123
cdroot
124-
start_cmd API "" "${CODER_DEV_SHIM}" server --address 0.0.0.0:3000 --swagger-enabled
124+
start_cmd API "" "${CODER_DEV_SHIM}" server --address 0.0.0.0:3000 --swagger-enable
125125

126126
echo '== Waiting for Coder to become ready'
127127
# Start the timeout in the background so interrupting this script

site/src/api/typesGenerated.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ export interface ServiceBanner {
618618

619619
// From codersdk/deploymentconfig.go
620620
export interface SwaggerConfig {
621-
readonly enabled: DeploymentConfigField<boolean>
621+
readonly enable: DeploymentConfigField<boolean>
622622
}
623623

624624
// From codersdk/deploymentconfig.go

0 commit comments

Comments
 (0)