validate

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package validate provides JSONL validation against the bd import schema. It checks each line of a JSONL file for required fields, valid types, and correct formats, producing detailed error messages with fix suggestions.

Index

Constants

This section is empty.

Variables

View Source
var ValidStatuses = []string{"open", "closed"}

ValidStatuses are the allowed values for the "status" field in a bead record.

View Source
var ValidTypes = []string{"bug", "task", "chore", "epic", "feature"}

ValidTypes are the allowed values for the "type" field in a bead record.

Functions

This section is empty.

Types

type Result

type Result struct {
	TotalLines int
	Errors     []ValidationError
}

Result contains the outcome of validating a JSONL file.

func Validate

func Validate(r io.Reader) *Result

Validate reads JSONL from r and validates each line against the bd import schema. It returns a Result with all validation errors found.

func (*Result) Valid

func (r *Result) Valid() bool

Valid returns true if no errors were found.

type ValidationError

type ValidationError struct {
	Line       int    // 1-based line number
	Field      string // field name (empty if line-level error)
	Message    string // what's wrong
	Suggestion string // how to fix it
}

ValidationError represents a single validation issue on a specific line.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

Jump to

Keyboard shortcuts

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