jsonstrict

package
v0.42.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package jsonstrict provides target-aware JSON key validation shared by transport and persisted event decoders.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckNoDuplicateKeysFor

func CheckNoDuplicateKeysFor(data []byte, target reflect.Type) error

CheckNoDuplicateKeysFor rejects repeated object keys. When an object is decoded into a struct, keys are compared with encoding/json's case-folding rules so two spellings cannot silently target the same field.

func FoldName

func FoldName(name string) string

FoldName folds a JSON name the same way encoding/json matches struct fields.

func FoldRune

func FoldRune(r rune) rune

FoldRune returns the smallest rune in r's simple case-folding orbit.

func ObjectFields

func ObjectFields(target reflect.Type) (map[string]reflect.Type, bool)

ObjectFields returns the fields encoding/json decodes an object into, keyed by their folded JSON name.

Types

This section is empty.

Jump to

Keyboard shortcuts

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