ast_post_processing

package
v2.948.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InferUnionDiscriminators

func InferUnionDiscriminators(ctx context.Context, types []*ast.TypeDef, schemaPath string, cfg map[string]any)

InferUnionDiscriminators analyzes all union types and infers discriminators where possible schemaPath is used for logging with clickable file:line:col links

func MarkOpenEnums

func MarkOpenEnums(types []*ast.TypeDef, cfg map[string]any)

MarkOpenEnums marks enums as open (tolerating unknown values) based on configuration and usage.

func MarkUnionsOpen

func MarkUnionsOpen(ctx context.Context, types []*ast.TypeDef, cfg map[string]interface{})

MarkUnionsOpen marks unions as open (tolerating unknown discriminator values) based on configuration and usage.

func MarkUsedInCallback

func MarkUsedInCallback(a *ast.AST)

MarkUsedInCallback marks all types that are used in callbacks by iterating through operations with callbacks

func MarkUsedInRequest

func MarkUsedInRequest(a *ast.AST)

MarkUsedInRequest marks all types that are used in requests by iterating through operations

func MarkUsedInResponse

func MarkUsedInResponse(a *ast.AST)

MarkUsedInResponse marks all types that are used in responses by iterating through operations

func MarkUsedInSecurity

func MarkUsedInSecurity(a *ast.AST)

MarkUsedInSecurity marks all types that are used in security by iterating through global and operation-level security

func MarkUsedInWebhook

func MarkUsedInWebhook(a *ast.AST)

MarkUsedInWebhook marks all types that are used in webhooks by iterating through webhook operations

func OperationRequestTypes

func OperationRequestTypes(operation *ast.Operation) iter.Seq[*ast.TypeDef]

func OperationResponseTypes

func OperationResponseTypes(operation *ast.Operation) iter.Seq[*ast.TypeDef]

func PreApplyUnionDiscriminators

func PreApplyUnionDiscriminators(ctx context.Context, a *ast.AST, cfg map[string]any)

PreApplyUnionDiscriminators sets const values on fields that are always used with the same discriminator value This simplifies the discriminator into a const field value when a type is consistently used across unions

func PropagateIncludeExtension

func PropagateIncludeExtension(types []*ast.TypeDef)

PropagateIncludeExtension propagates the x-speakeasy-include: true extension down the tree to everything reachable from types that have this extension set

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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