schema

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 27, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package schema embeds the canonical Prism JSON Schema bundle and exposes a loader for downstream packages.

Schemas live in schema/v1/. Each file has a URN $id of the form urn:prism:schema:v1:<name>. Cross-file $refs are relative paths (e.g. "data.schema.json#/$defs/data") that resolve within the embedded bundle. Validators register each file under both its URN and its filename so relative refs in source resolve identically to URN refs.

Index

Constants

View Source
const URNPrefix = "urn:prism:schema:v1:"

URNPrefix is the canonical URN prefix for all v1 schemas.

View Source
const Version = "v1"

Version is the schema bundle version that //go:embed walks.

Variables

Functions

func URNFor

func URNFor(name string) string

URNFor returns the canonical URN for a schema base name (e.g. "spec").

func V1Filenames

func V1Filenames() ([]string, error)

V1Filenames returns sorted file names (e.g. "spec.schema.json") for every embedded schema file.

func V1Schemas

func V1Schemas() (map[string][]byte, error)

V1Schemas returns the raw JSON bytes of every embedded schema file, keyed by the file's base name without the .schema.json suffix (e.g. "spec", "data"). _meta files are excluded — they are documentation, not schema resources.

Types

This section is empty.

Jump to

Keyboard shortcuts

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