Help us shape the future of Go! Take the 2026 Go Developer Survey

decode

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package decode converts native JSON semantics to safe validation feedback. It does not classify transport, storage, or application operational failures.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallbackError

func CallbackError(semantic *json.SemanticError) bool

CallbackError identifies ordinary errors from custom decoding methods, whose cause alone cannot establish whether the client supplied bad input. Explicit JSON syntax errors remain input errors. time.Time uses JSON v2's built-in representation, so its format errors retain normal input handling. Text methods are invoked only for JSON strings; native non-string rejection remains an input error. No application method is invoked by this inspection.

func Merge

func Merge(errs, schemaErrs validate.Errors, partial bool) validate.Errors

Merge adds schema violations to errs. JSON v2 leaves members after a failed decode untouched, so partial input suppresses misleading presence violations.

func Violation

func Violation(semantic *json.SemanticError) validate.Errors

Violation preserves the native JSON Pointer without treating GoType as a field-format description. Unknown names retain "unknown"; other semantic failures use "decode" with an optional qualified default representation. Native error text, input values, and Go type names never reach the message.

Types

This section is empty.

Jump to

Keyboard shortcuts

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