Documentation
¶
Overview ¶
Package openapi parses OpenAPI specs (YAML or JSON) into a flat list of endpoints. It is a dependency-light leaf package so both the documentation generator (pkg/doc) and the dashboard (pkg/dashboard) can consume it without creating an import cycle.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeriveOperationID ¶
DeriveOperationID builds a stable id from method+path when operationId is absent (e.g. GET /users/{id} -> get_users_id).
Types ¶
type Doc ¶
type Doc struct {
Servers []string
SecuritySchemes map[string]SecurityScheme
Security []SecurityRequirement
Components map[string]any
Operations []Operation
}
Doc is the rich, parsed representation of an OpenAPI spec: enough to derive executable agent tools (operations, parameters, request bodies) and to authenticate against the live service (security schemes and requirements).
type Operation ¶
type Operation struct {
ID string
Method string
Path string
Summary string
Description string
Parameters []Parameter
RequestBody *RequestBody
Security []SecurityRequirement
}
Operation is a single method+path pair from the spec's paths.
type Parameter ¶
type Parameter struct {
Name string
In string
Description string
Required bool
Schema map[string]any
}
Parameter is a single OpenAPI operation parameter (path/query/header/cookie).
type RequestBody ¶
RequestBody holds the application/json request body schema for an operation.
type SecurityRequirement ¶
SecurityRequirement maps a scheme name to its required scopes.