Automatically generate RESTful API documentation with Swagger 2.0 for Go.
This report summarizes scanner evidence for swaggo/swag, a Go project with 13,048 GitHub stars. SynthScan examined 39,141 lines of code across 292 source files, recording 125 pattern matches distributed across 3 syntactic categories. The legacy adjusted pattern signal is 3.3 (Low pattern signal); it is not an authorship estimate.
Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.
Use each vector to guide manual verification of the underlying findings.
Payload schema: 1.0.0 · Engine: 2.0.0 · Scoring: heuristic-density-v1 · Scan date: 2026-10-31.
Can maintainers explain intent, assumptions, and trade-offs? 121 finding(s).
Are imports declared and package/API names verified? 4 finding(s).
Are wrappers, guards, and repeated structures necessary? 0 finding(s).
Which changes need focused human review? 125 finding(s).
This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.
Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.
This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.
The scanner identified 125 distinct pattern matches across 3 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.
Reading the findings table: The Severity column indicates the configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | parser_test.go | 3021 | // // run the same code 100 times and check that the output is the same every time | COMMENT |
| LOW | README_pt.md | 241 | "github.com/swaggo/swag/example/celler/model" | COMMENT |
| LOW | README_pt.md | 321 | Por exemplo, utilizar | COMMENT |
| LOW | README_pt.md | 641 | COMMENT | |
| LOW | README_zh-CN.md | 141 | COMMENT | |
| LOW | README_zh-CN.md | 241 | // ShowAccount godoc | COMMENT |
| LOW | README_zh-CN.md | 261 | if err != nil { | COMMENT |
| LOW | README_zh-CN.md | 561 | ``` | COMMENT |
| LOW | README.md | 161 | import "github.com/swaggo/files" // swagger embed files | COMMENT |
| LOW | README.md | 261 | ) | COMMENT |
| LOW | README.md | 281 | } | COMMENT |
| LOW | README.md | 341 | COMMENT | |
| LOW | README.md | 661 | COMMENT | |
| LOW | formatter_test.go | 21 | func Test_FormatMain(t *testing.T) { | COMMENT |
| LOW | formatter_test.go | 41 | // @in header | COMMENT |
| LOW | formatter_test.go | 61 | // @tokenUrl https://example.com/oauth/token | COMMENT |
| LOW | formatter_test.go | 81 | // @BasePath /v2 | COMMENT |
| LOW | formatter_test.go | 121 | COMMENT | |
| LOW | formatter_test.go | 141 | COMMENT | |
| LOW | formatter_test.go | 161 | func GetStringByInt(w http.ResponseWriter, r *http.Request) {}` | COMMENT |
| LOW | testdata/extensionsFail1.go | 1 | package main | COMMENT |
| LOW | testdata/extensionsFail2.go | 1 | package main | COMMENT |
| LOW | testdata/templated.go | 1 | package main | COMMENT |
| LOW | testdata/templated.go | 21 | // @scope.admin Grants read and write access to administrative information | COMMENT |
| LOW | testdata/main.go | 1 | package main | COMMENT |
| LOW | testdata/main.go | 21 | // @securityDefinitions.apikey ApiKeyAuth | COMMENT |
| LOW | testdata/main.go | 41 | // @scope.admin Grants read and write access to administrative information | COMMENT |
| LOW | testdata/duplicated2/api/api.go | 1 | package api | COMMENT |
| LOW | testdata/duplicated2/api/api.go | 21 | func OptionsFoo(w http.ResponseWriter, r *http.Request) {} | COMMENT |
| LOW | testdata/struct_comment/api/api.go | 1 | package api | COMMENT |
| LOW | testdata/generics_property/api/api.go | 41 | // @Success 203 {object} NestedResponse "ok" | COMMENT |
| LOW | testdata/format_dst/main.go | 21 | // @host petstore.swagger.io | COMMENT |
| LOW | testdata/format_dst/api/api.go | 1 | package api | COMMENT |
| LOW | testdata/format_dst/api/api.go | 21 | //write your code | COMMENT |
| LOW | testdata/format_dst/api/api.go | 41 | // @Security OAuth2Password[admin] | COMMENT |
| LOW | testdata/tags2/main.go | 1 | package main | COMMENT |
| LOW | testdata/single_file_api/main.go | 1 | package main | COMMENT |
| LOW | testdata/non_exported_json_fields/main.go | 21 | NestedInternal string | COMMENT |
| LOW | testdata/format_test/main.go | 21 | // @host petstore.swagger.io | COMMENT |
| LOW | testdata/format_test/api/api.go | 1 | package api | COMMENT |
| LOW | testdata/format_test/api/api.go | 21 | //write your code | COMMENT |
| LOW | testdata/format_test/api/api.go | 41 | // @Security OAuth2Password[admin] | COMMENT |
| LOW | testdata/tags_nonexistend_tag/main.go | 1 | package main | COMMENT |
| LOW | testdata/global_security/main.go | 1 | package global_security | COMMENT |
| LOW | testdata/global_security/api/api.go | 21 | // @Router /testapi/basic [get] | COMMENT |
| LOW | testdata/json_field_string/main.go | 21 | // @Accept json | COMMENT |
| LOW | testdata/enums/main.go | 1 | package main | COMMENT |
| LOW | testdata/enums/api/api.go | 1 | package api | COMMENT |
| LOW | testdata/enums/api/api.go | 21 | // @Param typeinpath path types.Type true "type" | COMMENT |
| LOW | testdata/enums/api/api.go | 41 | // @Summary test array enums fields in formdata request | COMMENT |
| LOW | testdata/golist/api/api.go | 21 | Status string `json:"status"` | COMMENT |
| LOW | testdata/state/api/api_user.go | 1 | package api | COMMENT |
| LOW | testdata/state/api/api_user.go | 21 | // @State user | COMMENT |
| LOW | testdata/state/api/api_user.go | 41 | func GetStructArrayByStringUser(w http.ResponseWriter, r *http.Request) { | COMMENT |
| LOW | testdata/state/api/api.go | 1 | package api | COMMENT |
| LOW | testdata/state/api/api.go | 21 | // @State admin | COMMENT |
| LOW | testdata/state/api/api.go | 41 | func GetStructArrayByString(w http.ResponseWriter, r *http.Request) { | COMMENT |
| LOW | testdata/composition/api/api.go | 61 | // @Description get Bar | COMMENT |
| LOW | testdata/composition/api/api.go | 81 | } | COMMENT |
| LOW | testdata/composition/api/api.go | 101 | //write your code | COMMENT |
| 59 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | parser_test.go | 2054 | "description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swa | CODE |
| MEDIUM | testdata/pet/main.go | 5 | // @description This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io] | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | testdata/description_line_continuation/expected.json | 13 | "description": "This is a mock endpoint description which is long and descriptions that end with backsla | CODE |
| LOW | testdata/description_line_continuation/expected.json | 13 | "description": "This is a mock endpoint description which is long and descriptions that end with backsla | CODE |
| LOW | testdata/description_line_continuation/api/api.go | 14 | // @Description Lorem ipsum dolor sit amet \ | COMMENT |
| LOW | testdata/description_line_continuation/api/api.go | 14 | // @Description Lorem ipsum dolor sit amet \ | COMMENT |