schema

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package schema contains target-type-aware helpers used after syntax repair.

Index

Constants

This section is empty.

Variables

View Source
var ErrNoInference = errors.New("jsonrepair: no schema inference applied")

ErrNoInference is returned when no supported schema drift normalization applies.

Functions

func Fields

func Fields(v any) map[string]struct{}

Fields returns the JSON object fields declared by the target value.

func ObjectIntersectsFields

func ObjectIntersectsFields(text string, fields map[string]struct{}) bool

ObjectIntersectsFields reports whether text is a JSON object with any target field.

func UnmarshalWithTargetShape

func UnmarshalWithTargetShape(text string, v any) error

UnmarshalWithTargetShape normalizes supported schema drift using v's Go type, then unmarshals the normalized JSON into v.

Types

This section is empty.

Jump to

Keyboard shortcuts

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