# go-openapi/spec

> The Go object model for OpenAPI v2 (Swagger) specification documents

Source: https://talira.ai/catalog/go-openapi-spec-grg85471
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [developer tools / api / specification parsing](https://talira.ai/categories/developer-tools/api/specification-parsing), [languages / go](https://talira.ai/categories/languages/go)
- Licence: Apache-2.0[^1]
- Pricing: Free and open source[^1]
- Free tier: yes[^1]
- Backed by: [go-openapi](https://talira.ai/orgs/go-openapi.md)

go-openapi/spec is a Go package that models OpenAPI v2 (Swagger) specification documents: it marshals and unmarshals Swagger specs to and from a Go object model, and resolves and expands `$ref` references into a single root document. It's at the core of the go-openapi suite of packages and the [go-swagger](https://talira.ai/catalog/go-swagger-x5s28yp6.md) code generator, with a companion package (go-openapi/loads) for fetching specs as JSON or YAML. Its API is stable.

## Links

- GitHub: https://github.com/go-openapi/spec

## Problems it solves

- parse a Swagger 2.0 spec in Go
- resolve $ref references in an OpenAPI v2 document
- work with Swagger specs as Go structs

## Features

- Go object model for Swagger 2.0 specs
- marshal and unmarshal specs
- resolve and expand $ref references
- stable API

## Trust

Overall: 0.48 out of 1.
Signals: maintenance 0.69, adoption 0.53, momentum 0.19, community 0.65, backing 0.30, extensibility 0.00.

- last commit 7 days ago
- 13 commits in the last 90 days
- latest release v1.0.1 2 months ago
- 435 GitHub stars
- 42 contributors
- backed by go-openapi

## Related

- Works with [go-swagger](https://talira.ai/catalog/go-swagger-x5s28yp6.md)

## Sources

[^1]: https://github.com/go-openapi/spec/blob/master/LICENSE (checked 29 Nov 2026)
