Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
Generator creates OpenAPI documentation from recorded API calls
func NewGenerator ¶
NewGenerator creates a new generator
func (*Generator) SetTagMapping ¶
SetTagMapping sets a custom tag mapping for paths with a specific prefix
func (*Generator) SetUsePathGroups ¶
SetUsePathGroups configures whether to group APIs by path segments
func (*Generator) SetVersionPrefix ¶
SetVersionPrefix adds a custom version prefix for path handling
type OpenAPIConfig ¶
type OpenAPIConfig struct {
Title string
Description string
Version string
Servers []OpenAPIServer
TagMappings map[string]string // Maps path prefixes to custom tags
UsePathGroups bool // Whether to group APIs by path segments
VersionPrefixes map[string]bool // Custom version prefixes to detect
}
OpenAPIConfig holds configuration for the generator
type OpenAPIGenerator ¶
type OpenAPIGenerator struct {
// contains filtered or unexported fields
}
OpenAPIGenerator generates OpenAPI specs from API transactions
func NewOpenAPIGenerator ¶
func NewOpenAPIGenerator(config OpenAPIConfig) *OpenAPIGenerator
NewOpenAPIGenerator creates a new OpenAPI generator
func (*OpenAPIGenerator) AddTransaction ¶
func (g *OpenAPIGenerator) AddTransaction(tx proxy.APITransaction)
AddTransaction adds an API transaction to be analyzed
func (*OpenAPIGenerator) GenerateSpec ¶
func (g *OpenAPIGenerator) GenerateSpec() (*OpenAPISpec, error)
GenerateSpec generates an OpenAPI spec from the collected transactions
func (*OpenAPIGenerator) LoadTransactionsFromDirectory ¶
func (g *OpenAPIGenerator) LoadTransactionsFromDirectory(dirPath string) error
LoadTransactionsFromDirectory loads API transactions from all JSON files in a directory
func (*OpenAPIGenerator) LoadTransactionsFromFile ¶
func (g *OpenAPIGenerator) LoadTransactionsFromFile(filename string) error
LoadTransactionsFromFile loads API transactions from a file
type OpenAPIServer ¶
OpenAPIServer represents an API server in the OpenAPI spec
type OpenAPISpec ¶
OpenAPISpec is an alias for openapi3.T to make it clearer