Releases: fox-gonic/openapi
Releases · fox-gonic/openapi
Release list
v0.4.0
What's Changed
- Add a post-generation OpenAPI filter pipeline with Go API support via WithFilters.
- Add CLI/config filters with repeatable --filter expressions and --prune-unused-components.
- Support filtering operation extensions, OR alternatives, numeric/bool/string literals, and safe scalar comparisons.
- Add unused component pruning for schemas, responses, parameters, examples, request bodies, headers, security schemes, links, and callbacks while preserving discriminator mappings and operationRef references.
- Update English and Chinese README docs for manifest generation, entry compatibility, and filtering workflows.
Verification
- go test ./...
v0.3.0
Highlights
- Add route manifest mode so fox-openapi can generate OpenAPI documents from an exported Fox route manifest without running the application entry.
- Support
--route-manifestandrouteManifestconfig for manifest-based generation. - Enrich manifest handler symbols from source packages, including aliases, generic wrappers, value receivers, and optional
_test.gohandlers. - Infer status-wrapper responses more accurately and avoid exposing render wrapper types as public schemas.
- Document the v0.3.0 manifest workflow in both English and Simplified Chinese README files.
Upgrade Notes
For reproducible CI installs:
go install github.com/fox-gonic/openapi/cmd/fox-openapi@v0.3.0Manifest mode expects a compatible Fox route manifest, typically produced by fox.WriteRouteManifest(engine, path), then consumed with:
fox-openapi generate --route-manifest api/routes.manifest.json --out api/openapi.yamlFull Changelog: v0.2.1...v0.3.0
v0.2.1
🐛 修复
fox-openapi version不再硬编码输出 "dev":之前var version = \"dev\"没有任何注入机制,go install github.com/fox-gonic/openapi/cmd/fox-openapi@vX.Y.Z安装的二进制运行version命令也只会得到 "dev"。现在改用runtime/debug.ReadBuildInfo()解析模块版本:-ldflags \"-X main.version=...\"覆盖(CI/release 构建可注入)runtime/debug.ReadBuildInfo()的Main.Version←go install module@vX.Y.Z自动报告 tag- VCS revision (+dirty) 用于源码
go build - 兜底 "dev"
✅ 验证
升级后:
```bash
go install github.com/fox-gonic/openapi/cmd/fox-openapi@v0.2.1
fox-openapi version
v0.2.1
```
Full Changelog: v0.2.0...v0.2.1
v0.2.0
✨ 新特性
- Entry 函数自动发现:CLI 现在会扫描
sources自动定位符合 entry 签名的导出函数,零候选/多候选均给出明确诊断 // fox-openapi:entry标记:在多个 entry 形状函数共存时,无需删除其他辅助函数即可消歧- 位置参数限定发现范围:
fox-openapi generate ./internal/server仅缩小 entry 查找范围,注释提取仍按模块全量扫描,子包字段/handler 描述不再丢失 - 路径解析对齐 Go 工具链约定:CLI flags 相对 CWD、YAML 字段相对配置目录、位置参数仅作发现范围
serve默认挂载 swagger/scalar/redoc,并打印 entry/spec/ui 启动 bannergenerate/check/init同步输出 entry 信息(含 auto-discovered 标记)
🛠 改进
- 复用
matchEntrySignature共享 entry 签名校验 - 缓存
ResolvedEntry跳过 pipeline 中重复的packages.Load normalizeSourcePattern处理裸目录避免被go/packages识别为 stdlib importinit [path]路径无效时显式报错而非静默回退- 简化
hasEntryMarker:使用ast.CommentGroup.Text()统一处理注释格式 serveUI 路由用结构体而非字符串拼接,避免按空格切分
📚 文档
- 中英文 README 同步更新:自动发现、marker、路径解析规则
Full Changelog: v0.1.0...v0.2.0
v0.1.0
Changes
- Initial standalone OpenAPI module release.
- Add fox-openapi generate/check/serve/version CLI.
- Add config loading, runtime driver generation, offline UI assets, examples, docs, and CI fixture.
Dependency
- Requires github.com/fox-gonic/fox v0.0.11 or newer.