ObjectStackObjectStack

Plugin Validator — Kernel Protocol reference

Zod schemas for plugin validation data structures. These schemas align with the IPluginValidator contract interface.

Plugin Validator Protocol

Zod schemas for plugin validation data structures. These schemas align with the IPluginValidator contract interface.

Following ObjectStack "Zod First" principle - all data structures must have Zod schemas for runtime validation and JSON Schema generation.

Source: packages/spec/src/kernel/plugin-validator.zod.ts

TypeScript Usage

import { PluginMetadataSchema, ValidationErrorSchema, ValidationResultSchema, ValidationWarningSchema } from '@objectstack/spec/kernel';
import type { PluginMetadata, ValidationError, ValidationResult, ValidationWarning } from '@objectstack/spec/kernel';

// Validate data
const result = PluginMetadataSchema.parse(data);

PluginMetadata

Plugin metadata for validation

Properties

PropertyTypeRequiredDescription
namestring✅Unique plugin identifier
versionstringoptionalVersion (SemVer 2.0.0 — e.g. 1.0.0, 2.0.0-beta.1)
dependenciesstring[]optionalArray of plugin names this plugin depends on (hard — a missing name fails the boot)
optionalDependenciesstring[]optionalPlugin names hoisted ahead when composed, skipped when absent (order-if-present, ADR-0116)
requiresServicesstring[]optionalService names the plugin resolves synchronously during init(); validated by the kernel before Phase 1 (ADR-0116)
providesServicesstring[]optionalService names the plugin's init() unconditionally registers (ADR-0116)
signaturestringoptionalCryptographic signature for plugin verification

ValidationError

Properties

PropertyTypeRequiredDescription
fieldstring✅Field name that failed validation
messagestring✅Human-readable error message
codestringoptionalMachine-readable error code

ValidationResult

Properties

PropertyTypeRequiredDescription
validboolean✅Whether the plugin passed validation
errors{ field: string; message: string; code?: string }[]optionalValidation errors
warnings{ field: string; message: string; code?: string }[]optionalValidation warnings

Nested Shape: ValidationResult.errors[number]

PropertyTypeRequiredDescription
fieldstring✅Field name that failed validation
messagestring✅Human-readable error message
codestringoptionalMachine-readable error code

Nested Shape: ValidationResult.warnings[number]

PropertyTypeRequiredDescription
fieldstring✅Field name with warning
messagestring✅Human-readable warning message
codestringoptionalMachine-readable warning code

ValidationWarning

Properties

PropertyTypeRequiredDescription
fieldstring✅Field name with warning
messagestring✅Human-readable warning message
codestringoptionalMachine-readable warning code

On this page