Skip to content

Commit 3a54e51

Browse files
committed
Remove conditional check for swagger.json generation
Always run the swag command to ensure fresh API documentation generation. Co-authored-by: sreya <4856196+sreya@users.noreply.github.com>
1 parent 1f740ad commit 3a54e51

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

scripts/apidocgen/generate.sh

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,14 @@ trap cleanup EXIT
1717

1818
log "Use temporary file: ${API_MD_TMP_FILE}"
1919

20-
# Check if swagger.json already exists to avoid regeneration issues
21-
if [ ! -f "${PROJECT_ROOT}/coderd/apidoc/swagger.json" ]; then
22-
log "Generating swagger documentation..."
23-
pushd "${PROJECT_ROOT}/coderd"
24-
go run github.com/swaggo/swag/cmd/swag@v1.8.9 init \\
25-
--generalInfo="coderd.go" \\
26-
--dir=".,../codersdk,../enterprise/coderd,../enterprise/wsproxy/wsproxysdk" \\
27-
--output="./apidoc" \\
28-
--outputTypes="go,json" \\
29-
--parseDependency=true
30-
popd
31-
else
32-
log "swagger.json already exists, skipping generation"
33-
fi
20+
pushd "${PROJECT_ROOT}/coderd"
21+
go run github.com/swaggo/swag/cmd/swag@v1.8.9 init \\
22+
--generalInfo="coderd.go" \\
23+
--dir=".,../codersdk,../enterprise/coderd,../enterprise/wsproxy/wsproxysdk" \\
24+
--output="./apidoc" \\
25+
--outputTypes="go,json" \\
26+
--parseDependency=true
27+
popd
3428

3529
pushd "${APIDOCGEN_DIR}"
3630

0 commit comments

Comments
 (0)