Documentation
¶
Index ¶
- Constants
- func AddTypeToBucket(types ast.BucketedTypes, model string, typeDef *ast.TypeDef) ast.BucketedTypes
- func DeduplicateTypes(types ast.BucketedTypes) ast.BucketedTypes
- func GetOperationModelName(subsystem *subsystem.Subsystem, operation *ast.Operation) string
- type Bucketer
- func (b *Bucketer) BucketTypes(ctx context.Context, sdk *ast.AST) (ast.BucketedTypes, *sequencedmap.Map[string, *ast.Servers])
- func (b *Bucketer) GetDeduplicatedOperationModelName(operation *ast.Operation) string
- func (b *Bucketer) GetOperationModels(operation *ast.Operation, ignoreResponseSubTypes bool, ...) ast.BucketedTypes
- func (b *Bucketer) SetReservedModelFileNames(names []string)
- func (b *Bucketer) SetSplitThresholds(threshold, chunkSize int)
- func (b *Bucketer) SplitLargeModels(types ast.BucketedTypes, ...) ast.BucketedTypes
- type Sanitizer
Constants ¶
View Source
const ( SplitModelTypeThreshold = 200 SplitModelChunkSize = 150 )
Variables ¶
This section is empty.
Functions ¶
func AddTypeToBucket ¶
func AddTypeToBucket(types ast.BucketedTypes, model string, typeDef *ast.TypeDef) ast.BucketedTypes
func DeduplicateTypes ¶
func DeduplicateTypes(types ast.BucketedTypes) ast.BucketedTypes
Types ¶
type Bucketer ¶
type Bucketer struct {
// contains filtered or unexported fields
}
func (*Bucketer) BucketTypes ¶
func (b *Bucketer) BucketTypes(ctx context.Context, sdk *ast.AST) (ast.BucketedTypes, *sequencedmap.Map[string, *ast.Servers])
BucketTypes buckets types using the improved ordered maps.
func (*Bucketer) GetDeduplicatedOperationModelName ¶
func (*Bucketer) GetOperationModels ¶
func (*Bucketer) SetReservedModelFileNames ¶
SetReservedModelFileNames sets the list of sanitized filenames that must not be used as chunk names when splitting large models.
func (*Bucketer) SetSplitThresholds ¶
SetSplitThresholds overrides the default split-model thresholds.
func (*Bucketer) SplitLargeModels ¶
func (b *Bucketer) SplitLargeModels( types ast.BucketedTypes, operationServers *sequencedmap.Map[string, *ast.Servers], ) ast.BucketedTypes
SplitLargeModels splits models that exceed SplitModelTypeThreshold into smaller chunks of SplitModelChunkSize. Each chunk becomes a new model named after its last (most root-like) type after topological sorting. This prevents compiler complexity limits in languages like Python (pyright) and TypeScript (tsc).
Click to show internal directories.
Click to hide internal directories.