Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Module = fx.Module("parser", fx.Provide( fx.Annotate( NewSwaggerParser, fx.As(new(Parser)), ), NewAdjuster, ), )
Module provides the parser dependencies
Functions ¶
This section is empty.
Types ¶
type Adjuster ¶
type Adjuster struct {
// contains filtered or unexported fields
}
Adjuster provides filtering and description overrides based on YAML configuration
func (*Adjuster) ExistsInMCP ¶
ExistsInMCP checks if a route with the given method exists in MCP Returns true if the route/method IS in the selected routes
func (*Adjuster) GetDescription ¶
GetDescription returns the updated description for a route/method if it exists
type Parser ¶
type Parser interface {
// Init parses a Swagger/OpenAPI specification from a file
Init(openAPISpec string, adjustmentsFile string) error
// ParseReader parses a Swagger/OpenAPI specification from a reader
ParseReader(reader io.Reader) error
// GetRouteTools returns the parsed route tools
GetRouteTools() []*RouteTool
}
Parser handles parsing of Swagger/OpenAPI specifications
type RouteTool ¶
type RouteTool struct {
RouteConfig *requester.RouteConfig
Tool mcp.Tool
}
RouteTool combines a route configuration with its corresponding MCP tool
type SwaggerParser ¶
type SwaggerParser struct {
// contains filtered or unexported fields
}
SwaggerParser parses Swagger specifications and generates route configurations
func NewSwaggerParser ¶
func NewSwaggerParser(adjuster *Adjuster) *SwaggerParser
NewSwaggerParser creates a new SwaggerParser instance
func (*SwaggerParser) GetRouteTools ¶
func (p *SwaggerParser) GetRouteTools() []*RouteTool
GetRouteTools returns the parsed route tools
func (*SwaggerParser) Init ¶
func (p *SwaggerParser) Init(openAPISpec string, adjustmentsFile string) error
Init parses a Swagger/OpenAPI specification from a file
func (*SwaggerParser) ParseReader ¶
func (p *SwaggerParser) ParseReader(reader io.Reader) error
ParseReader parses a Swagger/OpenAPI specification from a reader