typeutil

package
v2.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package typeutil is a collection of type handling utility functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToWithJSONSchema

func ConvertToWithJSONSchema[From, To any](v From, resolvedSchema *jsonschema.Resolved) (To, error)

ConvertToWithJSONSchema converts the given value to another type using json marshal/unmarshal. If non-nil resolvedSchema is provided, validation against the resolvedSchema will run during the conversion.

func ValidateWithJSONSchema

func ValidateWithJSONSchema(v any, resolvedSchema *jsonschema.Resolved) error

ValidateWithJSONSchema validates a Go value against a resolved schema by first converting it to its JSON-decoded form to avoid struct validation issues.

Types

This section is empty.