Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add swagger api doc #441

Merged
merged 1 commit into from
Dec 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,9 @@ prepare-push: manifests generate fmt vet gql-gen
@sed -i '' '$(chart_rule_line_num),$$d' deploy/charts/arcadia/templates/rbac.yaml
@cat tmp_role.yaml >> deploy/charts/arcadia/templates/rbac.yaml
@rm -f tmp_role.yaml
@echo "install swag"
@go install github.com/swaggo/swag/cmd/swag@latest
@swag init -o apiserver/docs .

# Commands for Data-Processing
DATA_PROCESSING_IMAGE ?= kubebb/dp-base
Expand Down
2 changes: 2 additions & 0 deletions apiserver/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ type ServerConfig struct {
Host string
Port int
EnablePlayground bool
EnableSwagger bool
EnableOIDC bool

PlaygroundEndpointPrefix string
Expand All @@ -45,6 +46,7 @@ func NewServerFlags() ServerConfig {
flag.StringVar(&s.Host, "host", "", "bind to the host, default is 0.0.0.0")
flag.IntVar(&s.Port, "port", 8081, "service listening port")
flag.BoolVar(&s.EnablePlayground, "enable-playground", false, "enable the graphql playground")
flag.BoolVar(&s.EnableSwagger, "enable-swagger", true, "enable the swagger doc")
flag.BoolVar(&s.EnableOIDC, "enable-oidc", false, "enable oidc authorization")
flag.StringVar(&s.PlaygroundEndpointPrefix, "playground-endpoint-prefix", "", "this parameter should also be configured when the service is forwarded via ingress and a path prefix is configured to avoid not finding the service, such as /apis")
flag.StringVar(&s.IssuerURL, "issuer-url", "", "oidc issuer url(required when enable odic)")
Expand Down
Loading