Add OpenAPI/Swagger documentation
- Add Swagger dependencies to go.mod - Annotate all API endpoints with Swagger comments - Add Swagger UI at /api/v1/docs endpoint - Auto-generate Swagger docs in Dockerfile build - Update README with API documentation link
This commit is contained in:
@@ -15,6 +15,25 @@ import (
|
||||
"apocapoc-api/internal/infrastructure/persistence/sqlite"
|
||||
)
|
||||
|
||||
// @title Apocapoc API
|
||||
// @version 1.0
|
||||
// @description Self-hosted habit tracking service
|
||||
// @termsOfService http://swagger.io/terms/
|
||||
|
||||
// @contact.name API Support
|
||||
// @contact.url https://github.com/davidfolch/apocapoc-api
|
||||
|
||||
// @license.name MIT
|
||||
// @license.url https://opensource.org/licenses/MIT
|
||||
|
||||
// @host localhost:8080
|
||||
// @BasePath /api/v1
|
||||
|
||||
// @securityDefinitions.apikey BearerAuth
|
||||
// @in header
|
||||
// @name Authorization
|
||||
// @description Type "Bearer" followed by a space and JWT token.
|
||||
|
||||
func main() {
|
||||
cfg, err := config.Load()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user