schema

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package schema provides embedded JSON Schema files for structured requirements documents. These schemas can be used for validation and documentation purposes.

Index

Constants

View Source
const (
	// PRDSchemaID is the canonical ID for the PRD schema.
	PRDSchemaID = "https://github.com/grokify/structured-requirements/schema/prd.schema.json"

	// MRDSchemaID is the canonical ID for the MRD schema (placeholder).
	MRDSchemaID = "https://github.com/grokify/structured-requirements/schema/mrd.schema.json"

	// TRDSchemaID is the canonical ID for the TRD schema (placeholder).
	TRDSchemaID = "https://github.com/grokify/structured-requirements/schema/trd.schema.json"
)

SchemaID constants for referencing schemas.

Variables

View Source
var PRDSchemaJSON []byte

Functions

func PRDSchema

func PRDSchema() string

PRDSchema returns the PRD JSON Schema as a string.

func PRDSchemaBytes

func PRDSchemaBytes() []byte

PRDSchemaBytes returns the PRD JSON Schema as a byte slice.

Types

type Generator

type Generator struct {
	// Reflector is the jsonschema reflector used for generation.
	Reflector *jsonschema.Reflector
}

Generator creates JSON Schema files from Go types.

func NewGenerator

func NewGenerator() *Generator

NewGenerator creates a new schema generator with default settings.

func (*Generator) GenerateAll

func (g *Generator) GenerateAll(dir string) error

GenerateAll generates all schema files to the specified directory.

func (*Generator) GeneratePRDSchema

func (g *Generator) GeneratePRDSchema() (*jsonschema.Schema, error)

GeneratePRDSchema generates JSON Schema for the PRD Document type.

func (*Generator) GeneratePRDSchemaJSON

func (g *Generator) GeneratePRDSchemaJSON() ([]byte, error)

GeneratePRDSchemaJSON generates JSON Schema for PRD and returns it as JSON bytes.

func (*Generator) WritePRDSchema

func (g *Generator) WritePRDSchema(path string) error

WritePRDSchema generates and writes the PRD schema to a file.

Jump to

Keyboard shortcuts

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