fix: enable strict mode for swagger generation & upgrade swag by mtojek · Pull Request #21975 · coder/coder
added 2 commits
February 6, 2026 09:39The upstream swag CLI (v1.16.2) does not expose a --strict flag, so warnings about duplicate routes are silently ignored (exit code 0). With Strict mode, duplicate @router declarations become hard errors instead of silent overwrites. This adds a Go wrapper (scripts/apidocgen/swaginit/main.go) that calls the swag gen.Build() API directly with Strict: true, and updates generate.sh to use it instead of 'go tool swag init'.
Notable improvements: - Better generics support (map params, function-scoped types) - More precise numeric format annotations (float64, int64) - x-enum-descriptions for richer API docs - json:omitempty marks fields as optional - Security fix for CVE-2024-45338 (x/net) - Swagger output now uses spaces instead of tabs
mtojek
changed the title
fix(apidocgen): enable strict mode for swagger generation & upgrade swag
fix: enable strict mode for swagger generation & upgrade swag
mtojek
marked this pull request as ready for review
mtojek
deleted the
fix/apidocgen-strict-mode
branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters