feat: implement OpenAPI/Swagger documentation with swaggo/swag

📝 docs: add comprehensive API documentation
📦 dependencies: add swaggo/swag to go.mod
🔧 chore: add go:generate directive for documentation

- Add comprehensive API documentation using swaggo/swag
- Embed OpenAPI spec in binary using go:embed
- Add Swagger UI at /swagger/
- Document all endpoints, models, and validation rules
- Add go:generate directive for easy regeneration
- Update README, AGENTS, CHANGELOG with documentation
- Finalize ADR 0013 with implementation details
- Gitignore generated docs directory

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
2026-04-05 00:45:40 +02:00
parent 15fcb265bd
commit b279a31f88
12 changed files with 371 additions and 38 deletions

View File

@@ -346,6 +346,33 @@ curl -s http://localhost:8080/api/health
http://localhost:8080
```
### OpenAPI Documentation
**Swagger UI:** `http://localhost:8080/swagger/`
**OpenAPI Spec:** `http://localhost:8080/swagger/doc.json`
The API provides interactive documentation using Swagger UI with complete OpenAPI 2.0 specification. All endpoints, request/response models, and validation rules are documented.
**Features:**
- Interactive API exploration
- Try-it-out functionality
- Model schemas with examples
- Response examples
- Validation rules documentation
**Generation:** Documentation is auto-generated from code annotations using [swaggo/swag](https://github.com/swaggo/swag).
```bash
# Generate documentation
go generate ./pkg/server/
```
**Embedded Documentation:** The OpenAPI spec is embedded in the binary using Go's `//go:embed` directive for single-binary deployment.
---
### Health Check
### Health Check
```http
GET /api/health
@@ -819,7 +846,7 @@ defer cancel()
### Architectural Improvements
- [ ] Request validation middleware
- [ ] OpenAPI/Swagger documentation
- OpenAPI/Swagger documentation with embedded spec
- [ ] Enhanced OpenTelemetry instrumentation
- [ ] Metrics collection and visualization
- [ ] Health check improvements