Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertOpenAPIToJSONL ¶
ConvertOpenAPIToJSONL converts OpenAPI 3.0 or Swagger 2.0 spec to JSONL format If the file is already in JSONL format, it copies it to the output path
func IsJSONLFormat ¶
IsJSONLFormat checks if the file is already in JSONL format
Types ¶
type Endpoint ¶
type Endpoint struct {
Method string `json:"method"`
Path string `json:"path"`
Description string `json:"description"`
Parameters []Parameter `json:"parameters,omitempty"`
RequestBody string `json:"request_body,omitempty"`
Responses map[string]string `json:"responses,omitempty"`
RequiresAuth bool `json:"requires_auth"`
AuthType string `json:"auth_type"` // "bearer", "basic", "apikey", "none"
}
func LoadJSONLEndpoints ¶
LoadJSONLEndpoints loads endpoints from JSONL file
type JSONLEndpoint ¶
type JSONLEndpoint struct {
Method string `json:"method"`
Path string `json:"path"`
Summary string `json:"summary"`
Description string `json:"description,omitempty"`
Parameters []string `json:"parameters,omitempty"`
RequestBody map[string]any `json:"request_body,omitempty"`
Tags []string `json:"tags,omitempty"`
RequiresAuth bool `json:"requires_auth"`
AuthType string `json:"auth_type"` // "bearer", "basic", "apikey", "none"
}
JSONLEndpoint represents a single API endpoint in JSONL format
type Specification ¶
type Specification struct {
Format string `json:"format"`
Version string `json:"version,omitempty"`
Endpoints []Endpoint `json:"endpoints"`
RawContent string `json:"raw_content"`
}
func ParseShellScript ¶ added in v0.4.0
func ParseShellScript(path string) (*Specification, error)
ParseShellScript reads a shell script and extracts curl commands as Endpoints
func ParseSpecification ¶
func ParseSpecification(path string) (*Specification, error)
Click to show internal directories.
Click to hide internal directories.