detect

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindAllOfBaseRef

func FindAllOfBaseRef(schema *jsonschema.Schema) string

FindAllOfBaseRef extracts the base type name from allOf $ref composition. Returns the type name (e.g., "BaseField") if exactly one $ref is found in allOf, else "".

func ResolveVariantSchema

func ResolveVariantSchema(rootSchema *jsonschema.Schema, variant *jsonschema.Schema) *jsonschema.Schema

func ValidateEvent

func ValidateEvent(schema *jsonschema.Schema, event map[string]interface{}) error

Types

type UnionResult

type UnionResult struct {
	DiscriminatorField string
	Variants           []Variant
}

func DiscriminatedUnion

func DiscriminatedUnion(schema *jsonschema.Schema) (*UnionResult, error)

type Variant

type Variant struct {
	Name       string
	ConstValue string
	Schema     *jsonschema.Schema
	BaseType   string // Name of the base type from allOf $ref (if any)
}

Jump to

Keyboard shortcuts

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