This project contains a golang implementation of Swagger 2.0 (aka OpenAPI 2.0). It provide tools to work with swagger specifications.
Swagger is a simple yet powerful representation of your RESTful API.
-
2026-03-16 : v0.33.2 is out
- upgraded requirement to
go1.25 - bug fix release
- changes in our release workflow:
- releases and tags are signed
- all released artifacts are now signed. Signatures may be checked against
.sigartifacts. - deb and rpm packages are available on a new package name
go-swaggerinstead ofswagger - docker images now embarks a go installation (required to generate code)
- binary releases now ship as tarballs. See the updated installation instructions
- for convenience, plain binaries with the pre-existing OS/arch naming convention has been maintained for now
- removed dependencies:
- mongodb driver (NOT BREAKING: see also https://github.com/go-openapi/strfmt#announcements for support of drivers updates)
mailru/easyjson: not longer imported by default. See https://github.com/go-openapi/swag?tab=readme-ov-file#dependencies to enactmailru/easyjsonexplicitly.
- upgraded requirement to
-
2026-03-16 : new community chat on discord
- a new discord community channel is available to be notified of changes and support users
- our venerable Slack channel remains open, and will be eventually discontinued on 2026-06-30
- (for go-openapi libraries we'll stop Slack on 2026-03-31).
You may join the discord community by clicking the invite link on the discord badge (also above). .
go-swagger brings to the go community a complete suite of fully-featured, high-performance, API components to work with a Swagger API: server, client and data model.
- Generates a server from a swagger specification
- Generates a client from a swagger specification
- Generates a CLI (command line tool) from a swagger specification (alpha stage)
- Supports most features offered by jsonschema and swagger, including polymorphism
- Generates a swagger specification from annotated go code
- Additional tools to work with a swagger spec
- Great customization features, with vendor extensions and customizable templates
Our focus with code generation is to produce idiomatic, fast go code, which plays nice with golint, go vet etc.
This project supports OpenAPI 2.0. At this moment it does not support OpenAPI 3.x.
go-swagger is now feature complete and has stabilized its API.
Most features and building blocks are now in a stable state, with a rich set of CI tests.
The go-openapi community actively continues bringing fixes and enhancements to this code base.
There is still much room for improvement: contributors and PR's are welcome. You may also get in touch with maintainers on our slack channel.
go install github.com/go-swagger/go-swagger/cmd/swagger@latestgo-swagger is also available as binary or docker releases as well as from source: more details.
Try go-swagger in a free online workspace using Gitpod:
The toolkit itself is licensed under an Apache Software License 2.0: SPDX-License-Identifier: Apache-2.0.
Just like swagger, this does not cover code generated by the toolkit. That code is entirely yours to license however you see fit.