schemas

package
v2.932.15 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: AGPL-3.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Features

type Features interface {
	IsFeatureSupported(ctx context.Context, feature features.Feature) bool
	RecordFeatureUsage(ctx context.Context, feature features.Feature)
}

type LoopFrame

type LoopFrame struct {
	Type       string
	Restricted bool
}

type ParamType

type ParamType string
const (
	ParamTypePath   ParamType = "path"
	ParamTypeQuery  ParamType = "query"
	ParamTypeHeader ParamType = "header"
)

type Params

type Params struct {
	ContextStack               ast.ContextStack
	SerializationMethod        ast.SerializationMethod
	ParamType                  ParamType
	ParentOneOfSchema          *oas3.JSONSchema[oas3.Referenceable]
	Schema                     *oas3.JSONSchema[oas3.Referenceable]
	Encoding                   *sequencedmap.Map[string, *oas.Encoding]
	Scope                      ast.Scope
	IsRequest                  bool
	Depth                      int
	MaxDepth                   int
	Parents                    []string
	TypeDefCache               map[string]*ast.TypeDef // Avoid re-traversing the same subtree if we've already processed it
	LoopContext                []LoopFrame
	Nullable                   bool
	CircularReference          bool
	ParentComponentRef         references.Reference // If this schema is a inline component of a request/response component we will try to use the parent component ref to resolve the name
	ParentComponentDescription string
	UsedInUnion                bool
	DocInfo                    *document.DocumentInfo
	SkipNestedRefTracking      bool // Set to true for array items and additionalProperties (libopenapi bug doesn't affect these)
}

type Schemas

type Schemas struct {
	Config    *configuration.Config
	Target    types.Target
	Subsystem *subsystem.Subsystem
	Namer     *namer.Namer
}

func (*Schemas) HandleSchema

func (s *Schemas) HandleSchema(ctx context.Context, params Params) (*ast.FieldDef, error)

Checks schema for circular reference (adding it to the visited context stack) and then based on resolved type, creates FieldDef.

Jump to

Keyboard shortcuts

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