schema

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package schema generates the JSON Schema (draft 2020-12) document for the wire shapes of the Brigade Adapter Protocol v1 (plan 7.3): one document with a $defs entry per protocol type, reflected from the Go structs of internal/protocol with invopop/jsonschema and then patched where reflection cannot see the protocol's rules — the C-23 forbidden SendRequest members become `false` property schemas, pointer-typed members become nullable, and the 4.4.1 code-point caps become maxLength.

This package and its reflection dependency are DEV-ONLY: they are linked into cmd/brigade-schema (never shipped) and into tests, never into bin/brigade — `make deps-check` asserts the shipped binary's module set. Nothing under internal/protocol proper may import this package.

The generated document is committed as docs/protocol-v1.schema.json (`make schema`) and drift-checked in CI (`make schema-check`), so Document must be byte-stable: $defs is assembled in sorted-name order and every schema object marshals its members in a deterministic order (struct fields in declaration order, Go maps in sorted-key order).

Index

Constants

View Source
const SchemaID = "https://raw.githubusercontent.com/appshapes/brigade/master/docs/protocol-v1.schema.json"

SchemaID is the canonical location of the committed document.

Variables

This section is empty.

Functions

func Document

func Document() ([]byte, error)

Document returns the complete schema document, indented with two spaces and terminated by a newline. The bytes are stable across calls, runs and machines for a given version of this package and its dependencies; TestDocumentStable and `make schema-check` pin that.

Types

This section is empty.

Jump to

Keyboard shortcuts

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