fastAST

package
v2.936.1 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OperationIdKey = "operationId"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FastAST

type FastAST struct {
	OpenAPIVersion string `json:"openAPIVersion"`

	DocInfo *FastDocInfo `json:"docInfo"`

	Operations []*FastOperation `json:"operations"`

	// MCP context across all operations
	MCP *MCP `json:"mcp,omitempty"`

	// Terraform context across all operations
	Terraform *Terraform `json:"terraform,omitempty"`

	// GroupTree organizes operations into a hierarchical structure
	GroupTree *GroupTree `json:"groupTree"`
	// contains filtered or unexported fields
}

func NewFastAST

func NewFastAST(ctx context.Context, openAPIDocument *openapi.OpenAPI) (*FastAST, error)

type FastDocInfo

type FastDocInfo struct {
	Title       string `json:"title"`
	Version     string `json:"version"`
	Description string `json:"description"`
	Summary     string `json:"summary"`
}

type FastOperation

type FastOperation struct {
	OperationID string `json:"operationID"`
	Method      string `json:"method"`
	Description string `json:"description"`
	Summary     string `json:"summary"`
	DisplayName string `json:"displayName"`

	// The JSONPath of the operation, if any
	JSONPath string `json:"jsonPath"`

	// The group of the operation, if any
	// This is a computed value based on the owning SDK's group
	// which is set if the operation has a tag, or if the operation
	// is marked with x-speakeasy-group
	Group string `json:"group"`

	// Underlying OpenAPI tags array retrieved from the OpenAPI document
	Tags []string `json:"tags"`
}

type GroupNode

type GroupNode struct {
	Name       string                `json:"name"`
	Operations []*FastOperation      `json:"operations,omitempty"`
	Children   map[string]*GroupNode `json:"children,omitempty"`
	Parent     *GroupNode            `json:"-"`
}

GroupNode represents a node in the group tree

type GroupTree

type GroupTree struct {
	// contains filtered or unexported fields
}

GroupTree represents a tree structure for organizing operations into groups

func FromJSON

func FromJSON(jsonString string) (*GroupTree, error)

FromJSON creates a GroupTree from a JSON string

func NewGroupTree

func NewGroupTree() *GroupTree

NewGroupTree creates a new GroupTree instance

func (*GroupTree) AddOperation

func (gt *GroupTree) AddOperation(groupPath string, operation *FastOperation)

AddOperation adds an operation to the specified group path

func (*GroupTree) GetAllOperations

func (gt *GroupTree) GetAllOperations(groupPath string) []*FastOperation

GetAllOperations returns all operations in a group and its subgroups

func (*GroupTree) GetGroup

func (gt *GroupTree) GetGroup(groupPath string) *GroupNode

GetGroup returns the group node at the specified path

func (*GroupTree) MarshalJSON

func (gt *GroupTree) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface

func (*GroupTree) ToJSON

func (gt *GroupTree) ToJSON() (string, error)

ToJSON serializes the tree to a JSON string

type MCP

type MCP struct {
	Prompts   []*MCPPrompt   `json:"prompts,omitempty"`
	Resources []*MCPResource `json:"resources,omitempty"`
	Tools     []*MCPTool     `json:"tools,omitempty"`
}

Describes MCP context across all operations.

type MCPPrompt

type MCPPrompt struct {
	Description string `json:"description"`
	Name        string `json:"name"`
}

Describes a single MCP prompt.

type MCPResource

type MCPResource struct {
	Description string `json:"description"`
	Name        string `json:"name"`
}

Describes a single MCP resource.

type MCPTool

type MCPTool struct {
	// Tool description.
	Description string `json:"description"`

	// Set to true when tool generation is explicitly disabled.
	Disabled bool `json:"disabled"`

	// Tool name.
	Name string `json:"name"`

	// Associated API operation identifiers.
	OperationIDs []string `json:"operation_ids,omitempty"`

	// Scopes assigned to tool.
	Scopes []string `json:"scopes"`
}

Describes a single MCP tool.

type Terraform

type Terraform struct {
	DataResources    []*TerraformDataResource    `json:"data_resources,omitempty"`
	ManagedResources []*TerraformManagedResource `json:"managed_resources,omitempty"`
}

Describes Terraform context across all operations.

type TerraformDataResource

type TerraformDataResource struct {
	// Description of the data resource.
	Description string `json:"description"`

	// Name of the data resource, e.g. examplecloud_thing.
	Name string `json:"name"`

	// Associated API operation identifiers.
	OperationIDs []string `json:"operation_ids,omitempty"`
}

Describes a single Terraform data resource.

type TerraformManagedResource

type TerraformManagedResource struct {
	// Description of the managed resource.
	Description string `json:"description"`

	// Name of the managed resource, e.g. examplecloud_thing.
	Name string `json:"name"`

	// Associated API operation identifiers.
	OperationIDs []string `json:"operation_ids,omitempty"`
}

Describes a single Terraform managed resource.

Jump to

Keyboard shortcuts

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