gitea/routers
logikonline 9094d8b503 feat(api): add v2 API with AI-friendly features (Phase 2)
This introduces a new v2 API at /api/v2/ with features designed for
AI agents and automation tools while maintaining full backward
compatibility with the existing v1 API.

New features:
- Structured error codes (70+ machine-readable codes) for precise
  error handling by automated tools
- Scalar API documentation at /api/v2/docs (modern replacement for
  Swagger UI)
- Batch operations for bulk file and repository fetching
- NDJSON streaming endpoints for files, commits, and issues
- AI context endpoints providing rich repository summaries,
  navigation hints, and issue context

Files added:
- modules/errors/codes.go - Error code definitions and catalog
- modules/errors/api_error.go - Rich API error response builder
- routers/api/v2/api.go - v2 router with auth middleware
- routers/api/v2/docs.go - Scalar docs and OpenAPI spec
- routers/api/v2/batch.go - Batch file/repo operations
- routers/api/v2/streaming.go - NDJSON streaming endpoints
- routers/api/v2/ai_context.go - AI context endpoints
- routers/api/v2/misc.go - Version and user endpoints

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-09 11:41:10 -05:00
..
api feat(api): add v2 API with AI-friendly features (Phase 2) 2026-01-09 11:41:10 -05:00
common improve the compare page (#36261) 2026-01-01 10:32:19 -08:00
install Fix oauth2 session gob register (#36017) 2025-11-26 23:25:34 +08:00
private Fix the bug when ssh clone with redirect user or repository (#36039) 2025-12-04 19:17:49 +00:00
utils Refactor older tests to use testify (#33140) 2025-01-09 09:21:47 +08:00
web improve the compare page (#36261) 2026-01-01 10:32:19 -08:00
init.go feat(api): add v2 API with AI-friendly features (Phase 2) 2026-01-09 11:41:10 -05:00