Expand OpenAPI spec + MCP tooling for org-governance endpoints (#727 series) #738
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
The org-governance series (#728–#732, all merged to
dev) added five org-level API surfaces under/orgs/{org}/:/branch_protectionsrouters/api/v1/org/branch_protection.go/tag_protectionsrouters/api/v1/org/tag_protection.go/push_policyrouters/api/v1/org/push_policy.go/repo_defaultsrouters/api/v1/org/repo_defaults.go/email_domain_policyrouters/api/v1/org/email_domain.goRoutes, handlers, and DTOs (
modules/structs/org_*.go) are all in place and the code compiles/vets clean locally. But the handlers carry zero swagger annotations, so none of these endpoints appear in the generated OpenAPI spec (templates/swagger/v1_json.tmpl). They are functional but undocumented and undiscoverable.Why this gates the
dev → mainrelease (#733)A stable
mainrelease should not ship an undocumented API surface. Downstream API clients, generated SDKs, and the MCP server all derive from the OpenAPI spec — an un-annotated endpoint effectively doesn't exist for them.Scope
A. OpenAPI annotations + regen — blocks #733 merge to main
// swagger:operationdoc-comments to all handlers inrouters/api/v1/org/{branch_protection,tag_protection,push_policy,repo_defaults,email_domain}.go(params, body, responses, error codes).// swagger:responsemodels for the new response types inrouters/api/v1/swagger/.// swagger:parameterswhere theEdit*/Create*option DTOs are used as request bodies.templates/swagger/v1_json.tmplvia the swagger generator (now possible — Go toolchain available locally atA:\programs\go).go build ./...clean, spec validates, endpoints render in/api/swagger.B. MCP tooling — follows A (tracked here, does not block the merge)
mcp-mokogitea-apifor the new org endpoints:gitea_org_branch_protection_*,gitea_org_tag_protection_*,gitea_org_push_policy_*,gitea_org_repo_defaults_*,gitea_org_email_domain_policy_*.C. Repo-facing read views — follow-up (does not block)
Sequence
A → merge #733 to main → B → C. This issue tracks all three; A is the immediate blocker.
Related: #727 (parent), #728, #729, #730, #731, #732, #733 (release PR).
https://claude.ai/code/session_01Wsno14cxE49MstXFs9G5KT
Branch created:
feature/738-expand-openapi-spec-mcp-tooling-for-org-