Documentation
¶
Overview ¶
Package openapi derives agent.yaml capabilities from an existing OpenAPI spec, for `gora8 deploy --from-openapi` — so a SaaS company with a multi-operation REST API doesn't hand-author `capabilities:` one entry at a time.
This package deliberately does NOT parse parameters, request bodies, or build HTTP requests — that's the job of adapters-python's rest.py (gora8_adapters.rest), which is what actually runs the wrapper and calls the wrapped API. This package only needs enough of the spec to answer "what operations exist, and what should each be called and described as a capability" — the CLI never calls the wrapped API itself, so it never needs to know how to.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Load ¶
Load reads and parses an OpenAPI spec from a local file path (JSON or YAML, detected by content, not extension — the same convention adapters-python's rest.py uses) and returns every operation it declares, keyed by operationId (or a "method_path" fallback for operations that don't declare one). A malformed path or method entry is skipped, not fatal — one bad operation in a large spec shouldn't block deploying the other 39.
Types ¶
type Capability ¶
Capability is a plain id+description pair — deliberately not card.YAMLCapability, so this package stays decoupled from the CLI's specific manifest shape; callers convert at the call site.
func Capabilities ¶
func Capabilities(path string, allow []string) ([]Capability, error)
Capabilities derives agent.yaml capability entries from a spec file, one per operation, filtered to `allow` if non-empty — an explicit operationId allowlist. Deliberately doesn't default to publishing every operation a spec declares: account management, billing, and admin endpoints usually don't belong on gora8 even when an API's real task-shaped operations do.