fields

package
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyDefaults

func ApplyDefaults(values map[string]any, defs []Definition) map[string]any

ApplyDefaults fills missing schema-defined fields with default values or empty container values for object/repeater fields.

func Normalize

func Normalize(in map[string]any) map[string]any

Normalize ensures a field-value map is always non-nil.

func Validate

func Validate(values map[string]any, defs []Definition, allowAnything bool) []error

Validate checks a field-value map against schema definitions.

When allowAnything is false, values not declared in defs are rejected.

Types

type Definition

type Definition = config.FieldDefinition

Definition is the schema field definition type used by Foundry's structured content-modeling system.

func DefinitionsFor

func DefinitionsFor(cfg *config.Config, kind string) []Definition

DefinitionsFor returns the field definitions for a content kind.

Kind-specific schemas take precedence over the "default" schema.

type SchemaSet

type SchemaSet = config.FieldSchemaSet

SchemaSet is the configured set of field schemas keyed by content kind.

Jump to

Keyboard shortcuts

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