Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Endpoint ¶
type Endpoint struct {
Method string `json:"method"`
Path string `json:"path"`
Summary string `json:"summary"`
Tag string `json:"tag"`
}
Endpoint is a single method+path from the spec.
type EndpointDetail ¶
type EndpointDetail struct {
Method string `json:"method"`
Path string `json:"path"`
Summary string `json:"summary"`
Tag string `json:"tag"`
Description string `json:"description,omitempty"`
Parameters []Parameter `json:"parameters"`
RequestBody any `json:"request_body"`
Response any `json:"response_schema"`
}
EndpointDetail has full info for a single endpoint.
type OpenAPISpec ¶
type OpenAPISpec struct {
OpenAPI string `json:"openapi"`
Info json.RawMessage `json:"info"`
Paths map[string]map[string]json.RawMessage `json:"paths"`
Components json.RawMessage `json:"components"`
}
OpenAPISpec holds the parsed parts of the OpenAPI spec we care about.
func (*OpenAPISpec) Endpoints ¶
func (s *OpenAPISpec) Endpoints() []Endpoint
Endpoints returns a sorted list of all endpoints in the spec.
func (*OpenAPISpec) LookupEndpoint ¶
func (s *OpenAPISpec) LookupEndpoint(method, path string) (*EndpointDetail, error)
LookupEndpoint finds an endpoint by method and path, returning full detail. The path argument can be shorthand ("sessions") or absolute ("/api/v1/sessions").
Click to show internal directories.
Click to hide internal directories.