A Go source code scanner that produces Swagger 2.0 (OpenAPI 2.0) specifications from annotated Go source files.
Supports Go modules (since go1.11).
- 2025-04-19 : large package layout reshuffle
- the entire project is being refactored to restore a reasonable level of maintenability
- the only exposed API is Run() and Options.
API is stable.
go get github.com/go-openapi/codescanimport (
"github.com/go-openapi/codescan"
)
swaggerSpec, err := codescan.Run(&codescan.Options{
Packages: []string{"./..."},
})See https://github.com/go-openapi/codescan/releases
This library ships under the SPDX-License-Identifier: Apache-2.0.
See the license NOTICE, which recalls the licensing terms of all the pieces of software on top of which it has been built.
Maintainers can cut a new release by either:
- running this workflow
- or pushing a semver tag
- signed tags are preferred
- The tag message is prepended to release notes