api

package
v0.2.33 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 23, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCmd

func NewCmd() *cobra.Command

NewCmd creates the top-level `langsmith api` command.

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").

type Parameter

type Parameter struct {
	Name        string `json:"name"`
	In          string `json:"in"`
	Required    bool   `json:"required"`
	Type        string `json:"type,omitempty"`
	Description string `json:"description,omitempty"`
}

Parameter describes a single API parameter.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL