Reference in New Issue
Block a user
Delete Branch "feat/org-governance-openapi"
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?
Completes the documentation/OpenAPI surface for the org-governance series (#728–#732) so the stable
mainrelease (#733) ships a fully-described API. Resolves scope A of #738 (the item that gated the merge to main).OpenAPI / swagger (the gating work)
The five org-governance API groups were functional but undocumented — the four later handlers had zero swagger annotations and no
swagger:responsemodels were registered (even the existingbranch_protection.go$ref'd responses that were never defined). Now:swagger:responsemodels registered inrouters/api/v1/swagger/org.go:OrgBranchProtection/OrgBranchProtectionList,OrgTagProtection/OrgTagProtectionList, and singletonsOrgPushPolicy,OrgRepoDefaults,OrgEmailDomainPolicy.tag_protection.go(5),push_policy.go(3),repo_defaults.go(3),email_domain.go(3) — styled exactly like the existingbranch_protection.go, unique operationIds,orgpath param, body$refs to the correct DTOs,#/responses/emptyfor 204,notFound/validationError. No handler logic changed (annotations only).templates/swagger/v1_json.tmplandv1_openapi3_json.tmpl.Pre-existing spec blockers fixed as a prerequisite
The committed spec was stale and could not be regenerated at all. To produce a valid spec (no logic changes):
manifest.go: removed a stray comment glued to therepoUpdateManifestswagger block (broke YAML parsing), added missingowner/repopath params, registered aManifestresponse, gofmt whitespace.options.go: registered the org option DTOs + pre-existing unregistered defs (EditAccessTokenOption,IssueBulk*Option,Issue{Priority,Status,Type}Def) so there are no dangling$refs.Docs
[Unreleased]: recorded the recent build/CI fixes (#734, #735, #736, #737). (The org-governance features were already listed.)Verification (local, Go 1.26.3)
go build ./...→ clean (onlytests/integration, which is pre-existing-broken, excluded)gofmt -lon all edited.gofiles → cleanswagger validate→ valid against Swagger 2.0 (benign unused-response warnings only)v1_json.tmplRelated: #738 (tracker; B = MCP tools and C = repo-facing views remain), #727, #733.
https://claude.ai/code/session_01Wsno14cxE49MstXFs9G5KT
Annotate the four previously undocumented org-governance API handlers (tag_protection, push_policy, repo_defaults, email_domain) with swagger:operation blocks, and register the swagger:response models the branch_protection operations already referenced. Register the org option DTOs in the parameterBodies hack so their definitions are emitted. Also fix pre-existing spec-generation blockers surfaced once the spec became regenerable: a stray comment glued to the repoUpdateManifest swagger block (broke YAML parsing), missing owner/repo path params on the manifest operations, a Manifest response registration, and missing definitions for EditAccessTokenOption, the IssueBulk* options, and the Issue{Priority,Status,Type}Def types. Regenerated v1_json.tmpl and v1_openapi3_json.tmpl; spec now validates cleanly against Swagger 2.0. Claude-Session: https://claude.ai/code/session_01Wsno14cxE49MstXFs9G5KT