forked from leptonai/gpud
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathswag-gen.sh
More file actions
executable file
·23 lines (18 loc) · 765 Bytes
/
Copy pathswag-gen.sh
File metadata and controls
executable file
·23 lines (18 loc) · 765 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env bash
set -xue
# do not mask errors in a pipeline
set -o pipefail
# treat unset variables as an error
set -o nounset
# exit script whenever it errs
set -o errexit
# requires
# go install github.com/swaggo/swag/cmd/swag@1.16.6
# Generate swagger documentation
# --dir . : Search from root directory to find all Go files
# --generalInfo ./cmd/gpud/main.go : Specify the main file with general API info
# --output ./docs/apis : Output directory for generated docs
# --parseDependency : Parse dependency files
# --parseInternal : Parse internal packages
# --parseDepth 10 : Increase parse depth to ensure all handlers are found
swag init --dir . --generalInfo ./cmd/gpud/main.go --output ./docs/apis --parseDependency --parseInternal --parseDepth 10