validator

package
v1.3.7 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2025 License: Apache-2.0 Imports: 8 Imported by: 3 modules, 4 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateJSONLD

func ValidateJSONLD(doc string, options ...ValidateOpts) error

ValidateJSONLD validates jsonld structure.

func ValidateJSONLDMap

func ValidateJSONLDMap(
	docMap map[string]interface{},
	options ...ValidateOpts,
) error

ValidateJSONLDMap validates jsonld structure.

func ValidateJSONLDTypes added in v1.3.2

func ValidateJSONLDTypes(
	docMap map[string]interface{},
	options ...ValidateOpts,
) error

ValidateJSONLDTypes validates JSON-LD types.

Types

type Diff added in v1.3.0

type Diff struct {
	OriginalValue  interface{}
	CompactedValue interface{}
}

Diff represents the difference between two objects.

type ValidateOpts

type ValidateOpts func(opts *validateOpts)

ValidateOpts sets jsonld validation options.

func WithDocumentLoader

func WithDocumentLoader(jsonldDocumentLoader ld.DocumentLoader) ValidateOpts

WithDocumentLoader option is for passing custom JSON-LD document loader.

func WithExternalContext

func WithExternalContext(externalContext []string) ValidateOpts

WithExternalContext option is for definition of external context when doing JSON-LD operations.

func WithJSONLDIncludeDetailedStructureDiffOnError added in v1.3.0

func WithJSONLDIncludeDetailedStructureDiffOnError() ValidateOpts

WithJSONLDIncludeDetailedStructureDiffOnError option is for including detailed structure diff in error message.

func WithStrictContextURIPosition

func WithStrictContextURIPosition(uri string) ValidateOpts

WithStrictContextURIPosition sets strict validation of URI position within context property. The index of uri in underlying slice represents the position of given uri in @context array. Can be used for verifiable credential base context validation.

func WithStrictValidation

func WithStrictValidation(checkStructure bool) ValidateOpts

WithStrictValidation sets if strict validation should be used.

Jump to

Keyboard shortcuts

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