schemas

package
v1.0.21 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package schemas derives JSON Schema fragments from Go types via reflection.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyFieldOverrides

func ApplyFieldOverrides(schema map[string]interface{}, overrides map[string]FieldMeta) []string

ApplyFieldOverrides mutates schema in place; returns unresolved pointer paths (orphans).

func FromType

func FromType(t reflect.Type) json.RawMessage

FromType derives a JSON Schema for t (cached per reflect.Type).

func ResolvePointer

func ResolvePointer(schema map[string]interface{}, path string) []map[string]interface{}

ResolvePointer extends RFC 6901 with `/*` for array items; tolerates structural mismatches.

func WrapV2Envelope

func WrapV2Envelope(body json.RawMessage) json.RawMessage

WrapV2Envelope splices body into the `event` property; passes body through unchanged on parse fail.

Types

type FieldMeta

type FieldMeta struct {
	Description string
	Enum        []string
	Kind        string // renders to JSON Schema "format" (open_id / chat_id / timestamp_ms …)
}

FieldMeta overrides win over struct tags; non-empty fields replace schema annotations.

Jump to

Keyboard shortcuts

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