jsonvalue

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package jsonvalue preserves numeric tokens for domain operations that require exact JSON numbers, while retaining JSON v2's strict input validation.

Index

Constants

This section is empty.

Variables

View Source
var Numbers = json.WithUnmarshalers(json.UnmarshalFromFunc(func(decoder *jsontext.Decoder, value *any) error {
	if decoder.PeekKind() != '0' {
		return errors.ErrUnsupported
	}
	token, err := decoder.ReadToken()
	if err != nil {
		return err
	}
	*value = jsonv1.Number(token.String())
	return nil
}))

Numbers keeps the original numeric token instead of rounding it to float64. Non-number values use the ordinary JSON v2 decoder and its default semantics.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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