Skip to content

Commit

Permalink
feat: add swagger api doc
Browse files Browse the repository at this point in the history
Signed-off-by: Abirdcfly <[email protected]>
  • Loading branch information
Abirdcfly committed Dec 25, 2023
1 parent 8ef1b78 commit 833a99c
Show file tree
Hide file tree
Showing 13 changed files with 1,686 additions and 158 deletions.
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

0 comments on commit 833a99c

Please sign in to comment.