Documentation
¶
Index ¶
- Constants
- func AddChunkDefaultHeight(element any, height int) int
- func BuildReference(ctx *DrContext, ref low.IsReferenced)
- func CompareByParentPosition(a, b Foundational) bool
- func CopyRuleResultsByNodeID(source, target []*Node)
- func DefaultSchemaWorkers() int
- func DefaultWalkWorkers() int
- func ExtractKeyNodeForLowModel(obj any) *yaml.Node
- func ExtractParameterValues(params []*Parameter) []*v3.Parameter
- func ExtractValueNodeForLowModel(obj any) *yaml.Node
- func ParseSchemaSize(schema *base.Schema) (height, width int)
- func RefToJSONPath(ref string) string
- func ReleaseEdge(e *Edge)
- func ReleaseNode(n *Node)
- func RuleResultOwnedByNode(result *RuleFunctionResult, node *Node) bool
- func SourceFileForFoundational(candidate Foundational) string
- type AcceptsRuleResults
- type BuildError
- type Callback
- type ChangeSummary
- type ChildChangeSummary
- type Companion
- type Components
- type Contact
- type ContextKey
- type Discriminator
- type Doctor
- type Document
- type DrContext
- func (d *DrContext) BuildRefEdgeByLine(ctx context.Context, source *Foundation, ref string) bool
- func (d *DrContext) RunWalk(f func())
- func (d *DrContext) SubmitSchemaWalk(ctx context.Context, sch *SchemaProxy, baseSchema *base.SchemaProxy, depth int)
- func (d *DrContext) WaitForCompletion()
- func (d *DrContext) WalkContextForRef(ctx context.Context, isRef bool) context.Context
- type DynamicValue
- type Edge
- type Encoding
- type Example
- type ExternalDoc
- type Foundation
- func (f *Foundation) AddChange(change *NodeChange)
- func (f *Foundation) AddChanges(changes []*NodeChange)
- func (f *Foundation) AddEdge(edge *Edge)
- func (f *Foundation) AddRuleFunctionResult(result *RuleFunctionResult)
- func (f *Foundation) BuildNode(ctx context.Context, label, nodeType string, arrayType bool, ...) *Node
- func (f *Foundation) BuildNodesAndEdges(ctx context.Context, label, nodeType string, model high.GoesLowUntyped, ...)
- func (f *Foundation) BuildNodesAndEdgesWithArray(ctx context.Context, label, nodeType string, model high.GoesLowUntyped, ...)
- func (f *Foundation) BuildReferenceEdge(ctx context.Context, source, destination, ref string, poly string) *Edge
- func (f *Foundation) BuildSchemaNodeAndEdge(ctx context.Context, label string, model high.GoesLowUntyped, drModel any)
- func (f *Foundation) GenerateJSONPath() string
- func (f *Foundation) GenerateJSONPathWithLevel(level int) string
- func (f *Foundation) GetChanges() []*NodeChange
- func (f *Foundation) GetEdges() []*Edge
- func (f *Foundation) GetIndexValue() *int
- func (f *Foundation) GetInstanceType() string
- func (f *Foundation) GetKeyNode() *yaml.Node
- func (f *Foundation) GetKeyValue() string
- func (f *Foundation) GetNode() *Node
- func (f *Foundation) GetNodeParent() Foundational
- func (f *Foundation) GetParent() Foundational
- func (f *Foundation) GetPathSegment() string
- func (f *Foundation) GetRefNode() *Node
- func (f *Foundation) GetRoot() Foundational
- func (f *Foundation) GetRuleFunctionResults() []*RuleFunctionResult
- func (f *Foundation) GetSize() (height, width int)
- func (f *Foundation) GetValueNode() *yaml.Node
- func (f *Foundation) ProcessNodesAndEdges(ctx context.Context, label, nodeType string, model high.GoesLowUntyped, ...)
- func (f *Foundation) SetInstanceType(instanceType string)
- func (f *Foundation) SetNode(node *Node)
- func (f *Foundation) SetPathSegment(segment string)
- func (f *Foundation) SetRefNode(node *Node)
- type Foundational
- type HasIndex
- type HasSize
- type HasValue
- type Header
- type Info
- type IsObjectReference
- type License
- type Link
- type MediaType
- type Node
- type NodeChange
- func (n *NodeChange) GetAllChanges() []*model.Change
- func (n *NodeChange) GetHash() string
- func (n *NodeChange) GetLabel() string
- func (n *NodeChange) GetPath() string
- func (n *NodeChange) GetPropertyChanges() []*model.Change
- func (n *NodeChange) GetType() string
- func (n *NodeChange) PropertiesOnly()
- func (n *NodeChange) SetChanges(changes what_changed.Changed)
- func (n *NodeChange) TotalBreakingChanges() int
- func (n *NodeChange) TotalChanges() int
- type NodeChangeable
- type OAuthFlow
- type OAuthFlows
- type ObjectReference
- type Operation
- type Parameter
- type PathItem
- type Paths
- type RequestBody
- type Response
- type Responses
- type Rule
- type RuleCategory
- type RuleFunctionResult
- type Schema
- type SchemaProxy
- type SchemaWalkPool
- func (p *SchemaWalkPool) DrainAndShutdown()
- func (p *SchemaWalkPool) IsIdle() bool
- func (p *SchemaWalkPool) Shutdown()
- func (p *SchemaWalkPool) Submit(sch *SchemaProxy, baseSchema *base.SchemaProxy, depth int) bool
- func (p *SchemaWalkPool) SubmitOrWalk(sch *SchemaProxy, baseSchema *base.SchemaProxy, depth int)
- func (p *SchemaWalkPool) WaitForCompletion()
- type SchemaWorkItem
- type SecurityRequirement
- type SecurityScheme
- type Server
- type ServerVariable
- type Tag
- type Tardis
- type WalkPool
- func (p *WalkPool) DrainAndShutdown()
- func (p *WalkPool) InFlight() int64
- func (p *WalkPool) IsIdle() bool
- func (p *WalkPool) QueueLen() int
- func (p *WalkPool) Shutdown()
- func (p *WalkPool) Submit(fn func()) bool
- func (p *WalkPool) SubmitOrRun(fn func())
- func (p *WalkPool) WaitForCompletion()
- func (p *WalkPool) Workers() int
- type Walkable
- type WalkedHeader
- type WalkedMediaType
- type WalkedParam
- type WalkedSchema
- type XML
Constants ¶
const CHAR_WIDTH = 8
const DefaultSchemaWorkQueueSize = 5000
DefaultSchemaWorkQueueSize is the buffer size for pending schema walks. Set to 5000 to handle enterprise-scale OpenAPI specs out of the box.
const DefaultWalkWorkQueueSize = 5000
DefaultWalkWorkQueueSize is the buffer size for pending walk operations. Set to 5000 to handle enterprise-scale OpenAPI specs out of the box.
const HEIGHT = 25
const MAX_WIDTH = 700
const MIN_WIDTH = 150
const WIDTH = 200
Variables ¶
This section is empty.
Functions ¶
func AddChunkDefaultHeight ¶
func BuildReference ¶
func BuildReference(ctx *DrContext, ref low.IsReferenced)
func CompareByParentPosition ¶
func CompareByParentPosition(a, b Foundational) bool
CompareByParentPosition returns true if a's parent comes before b's parent in document order (lower line, or same line with lower column). This is used to ensure a deterministic schema collection when the same schema is encountered via multiple concurrent paths (e.g., via anyOf/oneOf refs). A nil parent (definition site) is always considered canonical.
func CopyRuleResultsByNodeID ¶ added in v0.0.61
func CopyRuleResultsByNodeID(source, target []*Node)
CopyRuleResultsByNodeID copies owned rule results from matching source nodes to target nodes. Aggregate results forwarded to roots are skipped; adding a copied child result may still forward the aggregate copy through normal Foundation behavior.
func DefaultSchemaWorkers ¶
func DefaultSchemaWorkers() int
DefaultSchemaWorkers returns the number of concurrent schema walkers. Scales with available CPU cores for optimal performance.
func DefaultWalkWorkers ¶
func DefaultWalkWorkers() int
DefaultWalkWorkers returns the number of concurrent walk workers. Scales with available CPU cores for optimal performance.
func ExtractParameterValues ¶ added in v0.0.50
func ExtractParameterValues(params []*Parameter) []*v3.Parameter
ExtractParameterValues extracts the underlying libopenapi Parameter values from a slice of doctor Parameter wrappers, preserving order and nil entries.
func ParseSchemaSize ¶
func RefToJSONPath ¶ added in v0.0.50
RefToJSONPath converts a JSON Reference string to a JSONPath node ID. e.g., "#/components/headers/RateLimit" -> "$.components.headers['RateLimit']" Handles JSON Pointer escapes (~0 -> ~, ~1 -> /) and external refs (file.yaml#/...).
func RuleResultOwnedByNode ¶ added in v0.0.61
func RuleResultOwnedByNode(result *RuleFunctionResult, node *Node) bool
RuleResultOwnedByNode reports whether a result belongs directly to the node, excluding copies forwarded to aggregate/root receivers.
func SourceFileForFoundational ¶ added in v0.0.61
func SourceFileForFoundational(candidate Foundational) string
SourceFileForFoundational returns the absolute spec path for a Doctor object when its underlying low model carries an index.
Types ¶
type AcceptsRuleResults ¶
type AcceptsRuleResults interface {
AddRuleFunctionResult(result *RuleFunctionResult)
GetRuleFunctionResults() []*RuleFunctionResult
}
type BuildError ¶
type BuildError struct {
Error error
SchemaProxy *base.SchemaProxy
DrSchemaProxy *SchemaProxy
}
type Callback ¶
type Callback struct {
Value *v3.Callback
Expression *orderedmap.Map[string, *PathItem]
Foundation
}
type ChangeSummary ¶ added in v0.0.50
type ChangeSummary struct {
Additions int `json:"additions"`
Modifications int `json:"modifications"`
Removals int `json:"removals"`
Breaking int `json:"breaking"`
Total int `json:"total"`
}
ChangeSummary holds aggregated change counts for a node's subtree.
type ChildChangeSummary ¶ added in v0.0.50
type ChildChangeSummary struct {
Label string `json:"label"`
Type string `json:"type"`
IdHash string `json:"idHash"`
NodeId string `json:"nodeId"`
Changes *ChangeSummary `json:"changes"`
}
ChildChangeSummary represents one child row in change-view rendering. Go field "ChildChangeSummaries" serializes as JSON "childChanges" via MarshalJSON.
type Companion ¶
Companion is implemented by any visitable object. It allows the tardis to travel through it. The secret to the doctor, is his companion.
type Components ¶
type Components struct {
Value *v3.Components
Schemas *orderedmap.Map[string, *SchemaProxy]
Responses *orderedmap.Map[string, *Response]
Parameters *orderedmap.Map[string, *Parameter]
Examples *orderedmap.Map[string, *Example]
RequestBodies *orderedmap.Map[string, *RequestBody]
Headers *orderedmap.Map[string, *Header]
SecuritySchemes *orderedmap.Map[string, *SecurityScheme]
Links *orderedmap.Map[string, *Link]
Callbacks *orderedmap.Map[string, *Callback]
PathItems *orderedmap.Map[string, *PathItem]
Foundation
}
func (*Components) GetSize ¶
func (c *Components) GetSize() (height, width int)
func (*Components) GetValue ¶
func (c *Components) GetValue() any
func (*Components) Walk ¶
func (c *Components) Walk(ctx context.Context, components *v3.Components)
type Contact ¶
type Contact struct {
Value *base.Contact `json:"contact,omitempty" yaml:"contact,omitempty"`
Foundation
}
type Discriminator ¶
type Discriminator struct {
Value *base.Discriminator
Foundation
}
func (*Discriminator) GetValue ¶
func (d *Discriminator) GetValue() any
type Doctor ¶
type Doctor interface {
LocateModelsByKeyAndValue(key, value *yaml.Node) ([]Foundational, error)
LocateModel(node *yaml.Node) ([]Foundational, error)
LocateModelByLine(line int) ([]Foundational, error)
}
Doctor who?
type Document ¶
type Document struct {
Document *v3.Document
Info *Info
Servers []*Server
Paths *Paths
Components *Components
Security []*SecurityRequirement
Tags []*Tag
ExternalDocs *ExternalDoc
Webhooks *orderedmap.Map[string, *PathItem]
Foundation
}
type DrContext ¶
type DrContext struct {
SchemaChan chan *WalkedSchema
ObjectChan chan any
SkippedSchemaChan chan *WalkedSchema
ParameterChan chan *WalkedParam
HeaderChan chan *WalkedHeader
MediaTypeChan chan *WalkedMediaType
ErrorChan chan *BuildError
NodeChan chan *Node
EdgeChan chan *Edge
Index *index.SpecIndex
Rolodex *index.Rolodex
V3Document *v3.Document
BuildGraph bool
RenderChanges bool
UseSchemaCache bool
SyncWalk bool // When true, walk everything synchronously (no goroutines)
PooledWalk bool // When true, use bounded worker pools (default)
SchemaPool *SchemaWalkPool // Bounded worker pool for schema walks
WalkPool *WalkPool // General bounded worker pool for all walk operations
DeterministicPaths bool // When true, component objects return definition-site paths
SchemaCache *sync.Map
CanonicalPathCache *sync.Map // Maps *yaml.Node pointer -> canonical JSONPath (definition site)
StringCache *sync.Map // String interning for common strings
StorageRoot string
WorkingDirectory string
Logger *slog.Logger
}
func GetDrContext ¶
func (*DrContext) BuildRefEdgeByLine ¶
BuildRefEdgeByLine creates a reference edge from source node to a component definition using the component's canonical JSONPath as target identifier. Returns true if edge was created successfully.
func (*DrContext) RunWalk ¶
func (d *DrContext) RunWalk(f func())
RunWalk submits work to the bounded a WalkPool or runs synchronously if SyncWalk is true. The pool automatically falls back to synchronous execution if the queue is full.
func (*DrContext) SubmitSchemaWalk ¶
func (d *DrContext) SubmitSchemaWalk(ctx context.Context, sch *SchemaProxy, baseSchema *base.SchemaProxy, depth int)
SubmitSchemaWalk submits a schema walk to the SchemaPool, or runs synchronously.
func (*DrContext) WaitForCompletion ¶
func (d *DrContext) WaitForCompletion()
WaitForCompletion blocks until all submitted walk operations have completed. In pooled mode, this waits for both WalkPool and SchemaPool to drain. In sync mode, this is a no-op (work already completed inline).
func (*DrContext) WalkContextForRef ¶
WalkContextForRef returns a context suitable for walking a $ref object. When DeterministicPaths is enabled and not rendering changes, BuildGraph is disabled to prevent creating duplicate nodes. The component definition creates the canonical node; reference usages only need edges.
type DynamicValue ¶
type DynamicValue[A, R, S, E any] struct { Value *base.DynamicValue[A, R] A S B E Foundation }
func (*DynamicValue[A, R, S, E]) GetValue ¶
func (d *DynamicValue[A, R, S, E]) GetValue() any
func (*DynamicValue[A, R, S, E]) Walk ¶
func (d *DynamicValue[A, R, S, E]) Walk(ctx context.Context)
type Edge ¶
type Edge struct {
Id string `json:"id"`
Sources []string `json:"sources"`
Targets []string `json:"targets"`
Poly string `json:"poly,omitempty"`
Ref string `json:"ref"`
}
func GenerateEdge ¶
type Encoding ¶
type Encoding struct {
Value *v3.Encoding
Headers *orderedmap.Map[string, *Header]
Foundation
}
type Example ¶
type Example struct {
Value *base.Example
Foundation
}
type ExternalDoc ¶
type ExternalDoc struct {
Value *base.ExternalDoc
Foundation
}
func (*ExternalDoc) GetValue ¶
func (ed *ExternalDoc) GetValue() any
func (*ExternalDoc) Walk ¶
func (ed *ExternalDoc) Walk(ctx context.Context, externalDoc *base.ExternalDoc)
type Foundation ¶
type Foundation struct {
PathSegment string
InstanceType string
IsIndexed bool
Index *int
Key string
PolyType string
Parent any
NodeParent any
RuleResults []*RuleFunctionResult
JSONPath string
Mutex sync.RWMutex
PathSegmentMutex sync.RWMutex // Separate mutex for PathSegment
JSONPathOnce sync.Once
Node *Node
NodeReference *Node // if the chain was broken, keep a reference
Edges []*Edge
KeyNode *yaml.Node
ValueNode *yaml.Node
Changes []*NodeChange
CacheSplit bool
}
func (*Foundation) AddChange ¶
func (f *Foundation) AddChange(change *NodeChange)
func (*Foundation) AddChanges ¶
func (f *Foundation) AddChanges(changes []*NodeChange)
func (*Foundation) AddEdge ¶
func (f *Foundation) AddEdge(edge *Edge)
func (*Foundation) AddRuleFunctionResult ¶
func (f *Foundation) AddRuleFunctionResult(result *RuleFunctionResult)
func (*Foundation) BuildNodesAndEdges ¶
func (f *Foundation) BuildNodesAndEdges(ctx context.Context, label, nodeType string, model high.GoesLowUntyped, drModel any)
func (*Foundation) BuildNodesAndEdgesWithArray ¶
func (f *Foundation) BuildNodesAndEdgesWithArray(ctx context.Context, label, nodeType string, model high.GoesLowUntyped, drModel any, arrayType bool, arrayCount int, arrayIndex *int)
func (*Foundation) BuildReferenceEdge ¶
func (*Foundation) BuildSchemaNodeAndEdge ¶
func (f *Foundation) BuildSchemaNodeAndEdge(ctx context.Context, label string, model high.GoesLowUntyped, drModel any)
func (*Foundation) GenerateJSONPath ¶
func (f *Foundation) GenerateJSONPath() string
func (*Foundation) GenerateJSONPathWithLevel ¶
func (f *Foundation) GenerateJSONPathWithLevel(level int) string
func (*Foundation) GetChanges ¶
func (f *Foundation) GetChanges() []*NodeChange
func (*Foundation) GetEdges ¶
func (f *Foundation) GetEdges() []*Edge
func (*Foundation) GetIndexValue ¶
func (f *Foundation) GetIndexValue() *int
func (*Foundation) GetInstanceType ¶
func (f *Foundation) GetInstanceType() string
func (*Foundation) GetKeyNode ¶
func (f *Foundation) GetKeyNode() *yaml.Node
func (*Foundation) GetKeyValue ¶
func (f *Foundation) GetKeyValue() string
func (*Foundation) GetNode ¶
func (f *Foundation) GetNode() *Node
func (*Foundation) GetNodeParent ¶
func (f *Foundation) GetNodeParent() Foundational
func (*Foundation) GetParent ¶
func (f *Foundation) GetParent() Foundational
func (*Foundation) GetPathSegment ¶
func (f *Foundation) GetPathSegment() string
func (*Foundation) GetRefNode ¶
func (f *Foundation) GetRefNode() *Node
func (*Foundation) GetRoot ¶
func (f *Foundation) GetRoot() Foundational
func (*Foundation) GetRuleFunctionResults ¶
func (f *Foundation) GetRuleFunctionResults() []*RuleFunctionResult
func (*Foundation) GetSize ¶ added in v0.0.50
func (f *Foundation) GetSize() (height, width int)
func (*Foundation) GetValueNode ¶
func (f *Foundation) GetValueNode() *yaml.Node
func (*Foundation) ProcessNodesAndEdges ¶
func (*Foundation) SetInstanceType ¶
func (f *Foundation) SetInstanceType(instanceType string)
func (*Foundation) SetNode ¶
func (f *Foundation) SetNode(node *Node)
func (*Foundation) SetPathSegment ¶
func (f *Foundation) SetPathSegment(segment string)
func (*Foundation) SetRefNode ¶
func (f *Foundation) SetRefNode(node *Node)
type Foundational ¶
type Foundational interface {
GetParent() Foundational
GetNodeParent() Foundational
GetPathSegment() string
GetKeyValue() string
GetIndexValue() *int
GenerateJSONPath() string
GenerateJSONPathWithLevel(level int) string
GetRoot() Foundational
SetNode(node *Node)
AddEdge(edge *Edge)
GetNode() *Node
GetRefNode() *Node
GetEdges() []*Edge
GetKeyNode() *yaml.Node
GetValueNode() *yaml.Node
GetInstanceType() string
SetInstanceType(instanceType string)
GetChanges() []*NodeChange
AddChanges(changes []*NodeChange)
AddChange(changes *NodeChange)
}
Foundational is the base interface for all models in the doctor. It provides a way to navigate the model
type Header ¶
type Header struct {
Value *v3.Header
Schema *SchemaProxy
Examples *orderedmap.Map[string, *Example]
Content *orderedmap.Map[string, *MediaType]
Foundation
}
type IsObjectReference ¶
type License ¶
type License struct {
Value *base.License
Foundation
}
type MediaType ¶
type MediaType struct {
Value *v3.MediaType
SchemaProxy *SchemaProxy
Examples *orderedmap.Map[string, *Example]
Encoding *orderedmap.Map[string, *Encoding]
Foundation
}
type Node ¶
type Node struct {
Value *yaml.Node `json:"-"`
Id string `json:"id"`
IdHash string `json:"idHash,omitempty"`
ParentId string `json:"parentId"`
Type string `json:"type"`
Label string `json:"label"`
Width int `json:"width"`
Height int `json:"height"`
Children []*Node `json:"nodes,omitempty"`
IsArray bool `json:"isArray,omitempty"`
IsPoly bool `json:"isPoly,omitempty"`
PolyType string `json:"polyType,omitempty"`
PropertyCount int `json:"propertyCount,omitempty"`
ArrayIndex int `json:"arrayIndex,omitempty"`
ArrayValues int `json:"arrayValues,omitempty"`
Extensions int `json:"extensions,omitempty"`
Hash string `json:"hash,omitempty"`
OriginLocation string `json:"originLocation,omitempty"`
Origin *index.NodeOrigin `json:"nodeOrigin,omitempty"`
KeyLine int `json:"-"`
ValueLine int `json:"valueLine"`
Instance any `json:"instance"`
DrInstance any `json:"-"`
Changes []what_changed.Changed `json:"-"`
RenderedChanges []*model.Change `json:"timeline,omitempty"`
CleanedChanged []*model.Change `json:"cleanedChanges,omitempty"`
SubtreeChanges *ChangeSummary `json:"-"`
ChildChangeSummaries []*ChildChangeSummary `json:"-"`
RenderProps bool `json:"-"`
RenderChanges bool `json:"-"`
RenderProblems bool `json:"-"`
RenderProblemsAsIds bool `json:"-"` // modified design to stop embedding violations in nodes, uses lookup now.
ViolationIdMap map[string]string `json:"-"`
Mutex sync.RWMutex `json:"-"`
// contains filtered or unexported fields
}
func GenerateNode ¶
func NewSyntheticNode ¶ added in v0.0.50
NewSyntheticNode creates a minimal Node for use outside the normal model walk. It is sufficient for tree/explorer rendering and the report path, but does not participate in ELK layout, edges, or object channel emission.
func (*Node) AppendChange ¶
func (n *Node) AppendChange(change what_changed.Changed)
func (*Node) GetChanges ¶
func (n *Node) GetChanges() []what_changed.Changed
Node methods for thread-safe access to Changes field
func (*Node) GetInstance ¶
func (*Node) MarshalJSON ¶
func (*Node) SetInstance ¶
type NodeChange ¶
type NodeChange struct {
Id string `json:"id,omitempty"`
IdHash string `json:"idHash,omitempty"`
Type string `json:"type,omitempty"`
Label string `json:"label,omitempty"`
Path string `json:"path,omitempty"`
Children []*Node `json:"nodes,omitempty"`
ArrayIndex int `json:"arrayIndex,omitempty"`
Changes what_changed.Changed `json:"timeline,omitempty"`
Mutex sync.RWMutex `json:"-"`
}
func (*NodeChange) GetAllChanges ¶
func (n *NodeChange) GetAllChanges() []*model.Change
func (*NodeChange) GetHash ¶
func (n *NodeChange) GetHash() string
func (*NodeChange) GetLabel ¶
func (n *NodeChange) GetLabel() string
func (*NodeChange) GetPath ¶
func (n *NodeChange) GetPath() string
func (*NodeChange) GetPropertyChanges ¶
func (n *NodeChange) GetPropertyChanges() []*model.Change
func (*NodeChange) GetType ¶
func (n *NodeChange) GetType() string
func (*NodeChange) PropertiesOnly ¶
func (n *NodeChange) PropertiesOnly()
func (*NodeChange) SetChanges ¶
func (n *NodeChange) SetChanges(changes what_changed.Changed)
func (*NodeChange) TotalBreakingChanges ¶
func (n *NodeChange) TotalBreakingChanges() int
func (*NodeChange) TotalChanges ¶
func (n *NodeChange) TotalChanges() int
type NodeChangeable ¶
type OAuthFlow ¶
type OAuthFlow struct {
Value *v3.OAuthFlow
Foundation
}
type OAuthFlows ¶
type OAuthFlows struct {
Value *v3.OAuthFlows
Implicit *OAuthFlow
Password *OAuthFlow
ClientCredentials *OAuthFlow
AuthorizationCode *OAuthFlow
Device *OAuthFlow
Foundation
}
func (*OAuthFlows) GetValue ¶
func (o *OAuthFlows) GetValue() any
func (*OAuthFlows) Walk ¶
func (o *OAuthFlows) Walk(ctx context.Context, flows *v3.OAuthFlows)
type ObjectReference ¶
type ObjectReference struct {
Reference string
Node *yaml.Node
Foundation
}
func (*ObjectReference) GetReference ¶
func (r *ObjectReference) GetReference() string
func (*ObjectReference) GetReferenceNode ¶
func (r *ObjectReference) GetReferenceNode() *yaml.Node
func (*ObjectReference) GetValue ¶
func (r *ObjectReference) GetValue() any
func (*ObjectReference) GoLowUntyped ¶
func (r *ObjectReference) GoLowUntyped() any
func (*ObjectReference) IsReference ¶
func (r *ObjectReference) IsReference() bool
type Operation ¶
type Operation struct {
Value *v3.Operation
ExternalDocs *ExternalDoc
Parameters []*Parameter
RequestBody *RequestBody
Responses *Responses
Callbacks *orderedmap.Map[string, *Callback]
Security []*SecurityRequirement
Servers []*Server
Tags *Foundation
Foundation
}
type Parameter ¶
type Parameter struct {
Value *v3.Parameter
SchemaProxy *SchemaProxy
Examples *orderedmap.Map[string, *Example]
Content *orderedmap.Map[string, *MediaType]
Foundation
}
type PathItem ¶
type PathItem struct {
Value *v3.PathItem
Get *Operation
Put *Operation
Post *Operation
Delete *Operation
Options *Operation
Head *Operation
Patch *Operation
Trace *Operation
Servers []*Server
Parameters []*Parameter
Foundation
}
func (*PathItem) GetOperations ¶
func (p *PathItem) GetOperations() *orderedmap.Map[string, *Operation]
type Paths ¶
type Paths struct {
Value *v3.Paths
PathItems *orderedmap.Map[string, *PathItem]
Foundation
}
type RequestBody ¶
type RequestBody struct {
Value *v3.RequestBody
Content *orderedmap.Map[string, *MediaType]
Foundation
}
func (*RequestBody) GetSize ¶
func (r *RequestBody) GetSize() (height, width int)
func (*RequestBody) GetValue ¶
func (r *RequestBody) GetValue() any
func (*RequestBody) Walk ¶
func (r *RequestBody) Walk(ctx context.Context, requestBody *v3.RequestBody)
type Response ¶
type Response struct {
Value *v3.Response
Headers *orderedmap.Map[string, *Header]
Content *orderedmap.Map[string, *MediaType]
Links *orderedmap.Map[string, *Link]
Foundation
}
type Responses ¶
type Responses struct {
Value *v3.Responses
Codes *orderedmap.Map[string, *Response]
Default *Response
Foundation
}
type Rule ¶
type Rule struct {
Id string `json:"id,omitempty" yaml:"id,omitempty"`
Description string `json:"description,omitempty" yaml:"description,omitempty"`
Message string `json:"message,omitempty" yaml:"message,omitempty"`
Recommended bool `json:"recommended,omitempty" yaml:"recommended,omitempty"`
Type string `json:"type,omitempty" yaml:"type,omitempty"`
Severity string `json:"severity,omitempty" yaml:"severity,omitempty"`
RuleCategory *RuleCategory `json:"category,omitempty" yaml:"category,omitempty"`
HowToFix string `json:"howToFix,omitempty" yaml:"howToFix,omitempty"`
}
Rule is a structure that represents a rule as part of a ruleset.
type RuleCategory ¶
type RuleFunctionResult ¶
type RuleFunctionResult struct {
Message string `json:"message" yaml:"message"`
Path string `json:"path" yaml:"path"`
RuleId string `json:"ruleId" yaml:"ruleId"`
RuleSeverity string `json:"ruleSeverity" yaml:"ruleSeverity"`
Origin *index.NodeOrigin `json:"origin,omitempty" yaml:"origin,omitempty"`
Rule *Rule `json:"-" yaml:"-"`
StartNode *yaml.Node `json:"-" yaml:"-"`
EndNode *yaml.Node `json:"-" yaml:"-"`
ParentObject any `json:"-" yaml:"-"`
}
RuleFunctionResult describes a failure with linting after being run through a rule
func CloneRuleFunctionResultForParent ¶ added in v0.0.61
func CloneRuleFunctionResultForParent(result *RuleFunctionResult, parent any) *RuleFunctionResult
CloneRuleFunctionResultForParent makes a shallow copy for a new owner.
func ConvertRuleResult ¶
func ConvertRuleResult(object any) *RuleFunctionResult
type Schema ¶
type Schema struct {
Name string
Value *base.Schema
Hash string
AllOf []*SchemaProxy
OneOf []*SchemaProxy
AnyOf []*SchemaProxy
PrefixItems []*SchemaProxy
Discriminator *Discriminator
Contains *SchemaProxy
If *SchemaProxy
Else *SchemaProxy
Then *SchemaProxy
DependentSchemas *orderedmap.Map[string, *SchemaProxy]
PatternProperties *orderedmap.Map[string, *SchemaProxy]
PropertyNames *SchemaProxy
UnevaluatedItems *SchemaProxy
UnevaluatedProperties *DynamicValue[*base.SchemaProxy, bool, *SchemaProxy, bool]
Items *DynamicValue[*base.SchemaProxy, bool, *SchemaProxy, bool]
Not *SchemaProxy
Properties *orderedmap.Map[string, *SchemaProxy]
AdditionalProperties *DynamicValue[*base.SchemaProxy, bool, *SchemaProxy, bool]
XML *XML
ExternalDocs *ExternalDoc
Walked bool
CacheCloneReady bool
Foundation
// contains filtered or unexported fields
}
type SchemaProxy ¶
type SchemaProxy struct {
Value *base.SchemaProxy
Schema *Schema
Foundation
}
func (*SchemaProxy) GetValue ¶
func (sp *SchemaProxy) GetValue() any
func (*SchemaProxy) IsCircular ¶
func (sp *SchemaProxy) IsCircular(ctx context.Context) bool
func (*SchemaProxy) Walk ¶
func (sp *SchemaProxy) Walk(ctx context.Context, schemaProxy *base.SchemaProxy, depth int)
type SchemaWalkPool ¶
type SchemaWalkPool struct {
// contains filtered or unexported fields
}
SchemaWalkPool manages bounded concurrent schema walking to prevent goroutine explosion on large OpenAPI specs.
func NewSchemaWalkPool ¶
func NewSchemaWalkPool(ctx context.Context, drCtx *DrContext, workers int) *SchemaWalkPool
NewSchemaWalkPool creates a pool with bounded workers. If workers <= 0, defaults to runtime.NumCPU() (one worker per core).
func (*SchemaWalkPool) DrainAndShutdown ¶
func (p *SchemaWalkPool) DrainAndShutdown()
DrainAndShutdown waits for all work to complete, then shuts down.
func (*SchemaWalkPool) IsIdle ¶
func (p *SchemaWalkPool) IsIdle() bool
IsIdle returns true if the pool has no work in progress.
func (*SchemaWalkPool) Shutdown ¶
func (p *SchemaWalkPool) Shutdown()
Shutdown closes the work channel and waits for all workers to finish.
func (*SchemaWalkPool) Submit ¶
func (p *SchemaWalkPool) Submit(sch *SchemaProxy, baseSchema *base.SchemaProxy, depth int) bool
Submit attempts to queue a schema for async walking. Returns true if queued or already cached/in-progress. Returns false if caller should walk synchronously (queue full or shutdown).
func (*SchemaWalkPool) SubmitOrWalk ¶
func (p *SchemaWalkPool) SubmitOrWalk(sch *SchemaProxy, baseSchema *base.SchemaProxy, depth int)
SubmitOrWalk submits to pool if possible, otherwise walks synchronously.
func (*SchemaWalkPool) WaitForCompletion ¶
func (p *SchemaWalkPool) WaitForCompletion()
WaitForCompletion blocks until all submitted work has completed. Uses sync.Cond for efficient blocking (no polling).
type SchemaWorkItem ¶
type SchemaWorkItem struct {
Schema *SchemaProxy
BaseSchema *base.SchemaProxy
Depth int
}
SchemaWorkItem represents a unit of work for schema walking.
type SecurityRequirement ¶
type SecurityRequirement struct {
Value *base.SecurityRequirement
Foundation
}
func (*SecurityRequirement) GetValue ¶
func (s *SecurityRequirement) GetValue() any
func (*SecurityRequirement) Travel ¶
func (s *SecurityRequirement) Travel(ctx context.Context, tardis Tardis)
func (*SecurityRequirement) Walk ¶
func (s *SecurityRequirement) Walk(ctx context.Context, securityRequirement *base.SecurityRequirement)
type SecurityScheme ¶
type SecurityScheme struct {
Value *v3.SecurityScheme
Flows *OAuthFlows
Foundation
}
func (*SecurityScheme) GetSize ¶
func (s *SecurityScheme) GetSize() (height, width int)
func (*SecurityScheme) GetValue ¶
func (s *SecurityScheme) GetValue() any
func (*SecurityScheme) Walk ¶
func (s *SecurityScheme) Walk(ctx context.Context, securityScheme *v3.SecurityScheme)
type Server ¶
type Server struct {
Value *v3.Server
Variables *orderedmap.Map[string, *ServerVariable]
Foundation
}
type ServerVariable ¶
type ServerVariable struct {
Value *v3.ServerVariable
Foundation
}
func (*ServerVariable) GetValue ¶
func (sv *ServerVariable) GetValue() any
func (*ServerVariable) Travel ¶
func (sv *ServerVariable) Travel(ctx context.Context, traveler Tardis)
func (*ServerVariable) Walk ¶
func (sv *ServerVariable) Walk(ctx context.Context, serverVariable *v3.ServerVariable, key string)
type Tag ¶
type Tag struct {
Value *libopenapibase.Tag
ExternalDocs *ExternalDoc
Foundation
}
type Tardis ¶
type Tardis interface {
// Visit visit any object that implements the Companion interface
Visit(ctx context.Context, object any)
// GetDoctor will call the doctor, are you ready for him is the question.
GetDoctor() Doctor
}
Tardis is a visitor pattern interface. Used in combination with Companion
type WalkPool ¶
type WalkPool struct {
// contains filtered or unexported fields
}
WalkPool is a bounded worker pool for executing walk operations. This prevents goroutine explosion when processing large OpenAPI specs by limiting the number of concurrent walkers to a fixed pool size.
func NewWalkPool ¶
NewWalkPool creates a bounded pool with the specified number of workers. If workers <= 0, defaults to runtime.NumCPU() (one worker per core).
func (*WalkPool) DrainAndShutdown ¶
func (p *WalkPool) DrainAndShutdown()
DrainAndShutdown waits for all work to complete, then shuts down.
func (*WalkPool) InFlight ¶
InFlight returns the current number of work items being processed or queued.
func (*WalkPool) Shutdown ¶
func (p *WalkPool) Shutdown()
Shutdown closes the work channel and waits for all workers to finish.
func (*WalkPool) Submit ¶
Submit attempts to queue a function for async execution. Returns true if queued successfully. Returns false if the queue is full or pool is shutting down (caller should run sync).
func (*WalkPool) SubmitOrRun ¶
func (p *WalkPool) SubmitOrRun(fn func())
SubmitOrRun submits to the pool if possible, otherwise runs synchronously.
func (*WalkPool) WaitForCompletion ¶
func (p *WalkPool) WaitForCompletion()
WaitForCompletion blocks until all submitted work has completed. Uses sync.Cond for efficient blocking (no polling).
type WalkedHeader ¶
type WalkedMediaType ¶
type WalkedParam ¶
type WalkedSchema ¶
Source Files
¶
- callback.go
- components.go
- contact.go
- context.go
- convert_results.go
- discriminator.go
- document.go
- dynamic_value.go
- encoding.go
- example.go
- external_doc.go
- foundation.go
- header.go
- info.go
- license.go
- link.go
- media_type.go
- node_edge.go
- oauth_flow.go
- oauth_flows.go
- operation.go
- parameter.go
- path_item.go
- paths.go
- request_body.go
- response.go
- responses.go
- rule_results.go
- schema.go
- schema_cache.go
- schema_pool.go
- schema_proxy.go
- security_requirement.go
- security_scheme.go
- server.go
- server_variable.go
- tag.go
- tardis.go
- walk_pool.go
- xml.go