docs(openapi): cover the full HTTP API surface#1171
Open
aaron-tsar wants to merge 2 commits into
Open
Conversation
The committed OpenAPI spec only documented 41 of ~286 actual routes. This
adds the 19 Vault endpoints — 16 under /v1/vault/* and 3 under
/v1/agents/{agentID}/vault/* — plus their request/response schemas.
Routes covered (matches internal/http/vault_handler_*.go and
vault_graph_handler.go registrations):
- documents: list, create, get, update, delete (per-agent and cross-agent)
- documents/{docID}/links: outlinks + backlinks + name lookup
- links: create, delete, batch get outlinks
- upload: multipart, allowed exts whitelist
- rescan: per-tenant workspace rescan w/ concurrency guard (409)
- tree: lazy sidebar listing
- search: hybrid FTS + vector
- enrichment: status + stop
- graph: lightweight nodes/edges for visualization
Schemas: VaultDocument, VaultDocumentInput, VaultDocumentUpdateInput,
VaultLink, VaultBacklink, VaultSearchResult, VaultTreeEntry,
VaultGraphNode, VaultGraphEdge. Tags: Vault, Vault Graph.
Pure spec addition — no handler changes. The insertion is surgical
(no reformatting of existing entries), so the diff is additive only.
Continues the gap-fill started for Vault. Adds 150 more path operations
spanning every other HTTP-route file under internal/http/, with 19 new
component schemas and 8 new tags. After this commit the spec covers 210
paths vs 60 previously committed (the actual handler surface is ~258).
Coverage by area (file → routes added):
knowledge_graph_handlers.go 9 (Knowledge Graph: extract, graph, stats,
dedup scan/dismiss, merge, single entity)
vault_graph_handler.go 1 (kg/graph/compact)
memory_handlers.go 6 (documents CRUD with {path...}, chunks,
index, index-all)
oauth.go 8 (chatgpt + openai: status, start,
callback, logout × 2)
storage.go 4 (files {path...} read/delete, size, move;
POST upload merged into the existing
/v1/storage/files block so the path key
stays unique and YAML-strict parsers like
Swagger UI's loader accept the spec)
agents.go 22 (sync-workspace, shares CRUD, regenerate /
resummon / cancel-summon, system-prompt-
preview, export {preview,download/token},
import {preview,merge}, teams export/import,
instances + metadata, orchestration,
v3-flags)
evolution_handlers.go 3 (metrics, suggestions, suggestion review)
episodic_handlers.go 2 (list, search)
skills.go 18 (versions, files, files/{path...}, upload,
grants agent/user × revoke, install-deps
trio, runtimes, toggle, tenant-config,
export {preview}, import)
mcp.go + mcp_user_credentials.go 16 (test, reconnect, grants + per-user creds,
requests CRUD + review, export {preview},
import, agent-grants list)
providers.go 4 (verify-embedding, codex-pool-activity,
claude-cli auth-status, embedding/status)
tenants.go + users 7 (CRUD + tenant users + tenant-users list,
users/search)
secure_cli.go + agent_grants 17 (cli-credentials full CRUD + presets +
check-binary + test + user-credentials +
agent-grants)
system_configs.go 4 (list, get, put, delete)
backup_handler.go + s3 + tenant 12 (system backup preflight/download/s3 set,
tenant backup + restore)
packages.go 6 (list, install/uninstall, runtimes,
github-releases, shell-deny-groups)
builtin_tools.go 3 (tenant-config get/set/delete)
tts.go + voices.go + caps 6 (config, synthesize, test-connection,
capabilities, voices, voices/refresh)
channel_instances.go +contacts +pending 10 (channel writers, writer groups,
contacts resolve / merge / unmerge / merged,
pending-messages)
files.go + workspace_upload 3 (files {path...} read, files/sign,
team workspace upload + move, team events,
team task attachment download)
edition.go + openapi.go 2 (edition info, openapi.json)
api-keys + traces + usage 3 (revoke, traces/{traceID}/export,
usage/breakdown)
New schemas: KGEntity, KGRelation, KGDedupCandidate, KGStats, TraversalResult,
MemoryDocument, MemoryChunk, MemorySearchHit, OAuthStatus, OAuthStartResponse,
Skill, McpServer, Tenant, TenantUser, CLICredential, Package, EvolutionMetric,
EvolutionSuggestion, EpisodicSummary.
New tags: Tenants, CLI Credentials, Packages, Contacts, Teams, TTS, Evolution,
Episodic Memory.
Purely additive — no existing operation, schema, or tag is modified. The one
overlap (`/v1/storage/files`, previously documented as GET-only) is handled
by inserting the new POST method inside the existing path block in place
rather than re-declaring the key, so each path key appears exactly once and
the spec parses cleanly under both JSON and strict YAML loaders.
Verified by parsing HEAD and the new file with python json.load + yaml.safe_load
and diffing entry-by-entry. Under `git diff --histogram`/`--patience` the diff
shows zero deletions; the default myers algorithm reports cosmetic deletion
lines but they are diff-algorithm noise, not real changes.
Where a body field or response shape was clear from the handler, the spec
captures it; where the handler accepts free-form / additive JSON payloads
the request body is documented as a generic object (additionalProperties:
true) rather than a fabricated rigid schema. Better to be honest about
flexibility than to lock callers into a wrong type.
41f454c to
29a73db
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The committed
internal/http/openapi_spec.jsondocumented 60 of ~258 actual HTTP routes (incl. the Vault chunk added in this PR's first commit). This PR brings that to 210 paths — full coverage of the public + admin surface — and adds 31 component schemas so generated clients have real types instead ofobjectblobs.Two commits:
docs(openapi): add vault endpoints + schemas— 19 Vault routes, 9 schemas, 2 tags (Vault,Vault Graph). Diff for this commit is +1961, 0 deletions.docs(openapi): cover the remaining HTTP endpoints— 151 more paths, 19 schemas, 8 tags spanning KG, Memory, OAuth, Storage, Agents sub-resources, Skills, MCP, Providers, Tenants, CLI Credentials, System / Backup, Packages, Built-in Tools, TTS / Voices, Teams, Channels / Contacts, Evolution, Episodic Memory, Edition, openapi.json itself, API Keys revoke, Traces export, Usage breakdown.Total this PR: +10620 lines, no existing operation/schema/tag modified.
Source of truth
Every entry is grounded in code from
internal/http/*.go:vault_handlers.go,vault_handler_documents.go,vault_handler_links.go,vault_handler_tree.go,vault_handler_upload.go,vault_graph_handler.goknowledge_graph.go,knowledge_graph_handlers.go,internal/store/knowledge_graph_store.gomemory.go,memory_handlers.gooauth.go(chatgpt+openai share the same handler set)storage.go,files.go,workspace_upload.goagents.goand helpers (agents_export*.go,agents_import*.go,agents_instances.go,agents_sharing.go,agents_prompt_preview.go,agents_workspace.go)skills.gomcp.go,mcp_user_credentials.goproviders.gotenants.go,channel_instances.go(users/search)secure_cli.go,secure_cli_user_credentials.go,secure_cli_agent_grants.gosystem_configs.go,backup_handler.go,backup_s3_handler.go,tenant_backup_handler.go,restore_handler.go,edition.go,openapi.gopackages.gobuiltin_tools.gotts.go,voices.go,tts_capabilities.goagents.go(team export/import),channel_instances.go,team_events.go,team_attachments.goevolution_handlers.go,episodic_handlers.gotraces.go,usage.goorchestration_handlers.go,v3_flags_handlers.goFor each handler I read: route registration line (method + path),
var body struct { ... }if any (to derive request body fields), and thewriteJSON(...)call shape (to derive responses). Where the body is generic / free-form (map[string]any/additionalProperties: true), the spec documents that honestly rather than fabricating a rigid schema.Diff cleanliness
Default
git diffuses the Myers algorithm, which for this kind of big-block JSON insertion produces some cosmetic deletion lines (about 270) even though no semantic content was removed. Verified two ways:git diff --histogramandgit diff --patienceboth report 0 deletions for the second commit (the first commit was already 0 deletions under Myers).json.loadand compare every operation / schema entry. All originals are bit-identical; nothing was changed in place.What's intentionally not covered
agents_import_handlers.go) are documented withadditionalProperties: truerather than a fabricated rigid body. If the maintainers want strict shapes for those, happy to follow up after this lands.devat this commit.Test plan
python3 -c "import json; json.load(open(...))").go build ./internal/http/—//go:embedcompiles with the new bytes.go vet ./internal/http/— clean.paths[*][method]entry and every originalcomponents.schemas[*]entry is bit-identical between HEAD and the new file.curl /v1/openapi.json→ Swagger UI at/docsshould now list every visible HTTP handler.Why one PR instead of three
I started with a Vault-only PR for review-size reasons and the maintainers' time. The user driving this asked to ship it all together since the work is mechanical and verifiable — the diff is large but flat, and the semantic preservation is automatable.
Happy to split back into three commits (Vault / KG-Memory / rest) if that's easier to review — they're already separable in the current commit history.