Versions in this module Expand all Collapse all v0 v0.7.0 Dec 2, 2025 v0.6.0 Nov 27, 2025 Changes in this version + var EscapeSJSONKey = strings.NewReplacer("\\", "\\\\", "|", "\\|", "#", "\\#", "@", "\\@", "*", "\\*", ".", "\\.", ":", "\\:", "?", "\\?").Replace + func Marshal(value any) ([]byte, error) + func MarshalRoot(value any) ([]byte, error) + func Port(from any, to any) error + func RegisterDiscriminatedUnion[T any](key string, mappings map[string]reflect.Type) + func RegisterFieldValidator[T any, V string | bool | int](fieldName string, values ...V) + func RegisterUnion[T any](discriminator string, variants ...UnionVariant) + func Unmarshal(raw []byte, to any) error + func UnmarshalRoot(raw []byte, to any) error + type Field struct + func (j Field) IsInvalid() bool + func (j Field) IsMissing() bool + func (j Field) IsNull() bool + func (j Field) Raw() string + type UnionUnmarshaler struct + Value T + func (c *UnionUnmarshaler[T]) UnmarshalJSON(buf []byte) error + type UnionVariant struct + DiscriminatorValue any + Type reflect.Type + TypeFilter gjson.Type + func Discriminator[T any](value any) UnionVariant