docspec

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildDocSpecLLMPrompt

func BuildDocSpecLLMPrompt(apiName, docsContent string) string

BuildDocSpecLLMPrompt constructs a prompt that asks the LLM to read API docs and output a YAML spec in the format expected by spec.ParseBytes.

func ExtractYAML

func ExtractYAML(response string) string

ExtractYAML strips markdown code fences from LLM output to get raw YAML.

func GenerateFromDocs

func GenerateFromDocs(docsURL, apiName string) (*spec.APISpec, error)

GenerateFromDocs fetches an API documentation page and extracts a best-effort APISpec by scanning for endpoint patterns, auth hints, and parameters.

func GenerateFromDocsLLM

func GenerateFromDocsLLM(docsURL, apiName string) (*spec.APISpec, error)

GenerateFromDocsLLM uses an LLM to understand API documentation and produce a structured APISpec. Falls back to regex-based GenerateFromDocs on failure.

Types

This section is empty.

Jump to

Keyboard shortcuts

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