docval

package
v0.2.3-alpha02 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateAndParse

func ValidateAndParse(docBytes []byte, schemaBytes []byte, docType string) (map[string]any, error)

ValidateAndParse is the only exported function. It accepts raw document bytes (YAML or JSON), a JSON Schema (bytes), and a docType tag (reserved for future behavior). It returns the parsed markup as map[string]any when the JSON Schema validates.

func ValidateAndParseFile

func ValidateAndParseFile(docPath string, schemaPath string) (map[string]any, error)

ValidateAndParseFile loads a document and its schema from the local filesystem, rewrites external $ref values to absolute file:// URLs, and delegates to ValidateAndParse().

Example:

parsed, err := docval.ValidateAndParseFile("fragment.yaml", "fragmented-resources.schema.json", "fragment")

Types

This section is empty.

Jump to

Keyboard shortcuts

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