A lightweight, framework-agnostic OpenAPI 3.x specification builder for Go, offering programmatic control and zero dependencies.
oaswrap/spec is a lightweight, framework-agnostic OpenAPI 3.x specification builder for Go. It allows developers to programmatically create API documentation using pure Go code, providing type safety and avoiding vendor lock-in. The library supports both static spec generation for CI/CD pipelines and integration with popular Go web frameworks via adapters.
Go developers building REST APIs who need programmatic, type-safe OpenAPI documentation generation, especially those working with existing codebases or multiple web frameworks.
Developers choose oaswrap/spec for its framework-agnostic design, zero dependencies, and code-first approach that offers better IDE support and type safety compared to annotation-based alternatives. It provides flexibility for both static generation and live integration.
⚡A lightweight, framework-agnostic OpenAPI 3.x specification builder for Go.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Works with any Go web framework or as a standalone tool, allowing integration into diverse codebases without vendor lock-in, as highlighted in the README's adapter ecosystem for Chi, Echo, Gin, and more.
Uses pure Go code with struct tags for full type safety, providing better IDE support and compile-time checks compared to annotation-based alternatives like swaggo.
Offers dedicated adapters for popular frameworks that enable automatic spec generation and built-in documentation UI at endpoints like /docs, reducing setup time for integrated use.
Supports static spec generation at build time with methods like WriteSchemaTo, making it ideal for documentation pipelines and version-controlled API specs, as shown in the static generation example.
The library is in active development and considered beta, requiring thorough testing before production use, with potential for breaking changes as admitted in the FAQ.
Focuses solely on documentation generation without built-in request/response validation, unlike frameworks like Huma, which means additional middleware is needed for full API lifecycle management.
Requires writing explicit Go code for spec definitions, which can be more verbose and time-consuming than annotation-based systems for straightforward APIs, adding boilerplate.