YounndAI Domains

YounndAI Domains

The Schema Registry

Typed schemas for
every industry

Structured tags with typed fields, validation rules, and trust signals. Open standard. Managed registry.

Explore RegistryLearn the Format
31 Official Domains//Open Standard//Schema as a Service
YounndAI Domains
DomainsSchemaPricingDocs
  1. Docs
  2. Sdk
  3. Validation
sdk

Validation

Validate JavaScript objects against YounndAI Domain schemas.

Quick Example

import { validateRecord } from "@younndai/domains";

const result = await validateRecord("yon.fintech", "TXN", {
  id: "txn-001",
  amount: 1500.5,
  currency: "USD",
});

5 Constraint Types

ConstraintDescriptionExample
requiredField must be present{ required: true }
typeValue type must match{ type: 'int' }
rangeNumeric value within bounds{ range: [0, 999999] }
enumValue in allowed set{ enum: ['USD', 'EUR'] }
patternString matches regex{ pattern: '^[A-Z]{3}$' }

Sync Validation

When you already have the schema, skip network resolution:

import { validateRecordSync, getBundledDomain } from "@younndai/domains";

const domain = getBundledDomain("yon.fintech")!;
const result = validateRecordSync("TXN", { id: "txn-001" }, domain);

Batch Validation

Each domain is resolved once — efficient for hundreds of records:

import { validateRecords } from "@younndai/domains";

const results = await validateRecords([
  { domainId: "yon.fintech", tag: "TXN", data: { id: "txn-001", amount: 100 } },
  { domainId: "yon.health", tag: "VITALS", data: { bp: "120/80" } },
]);

Error Behavior

  • Domain not found: Returns { valid: false, errors: [{ field: '_domain' }] } — never throws
  • Tag not found: Returns { valid: false, errors: [{ field: '_tag' }] } — never throws

ValidationResult Type

interface ValidationResult {
  valid: boolean;
  errors: ValidationError[];
  warnings: ValidationError[];
}

interface ValidationError {
  field: string;
  message: string;
  constraint: "required" | "type" | "range" | "enum" | "pattern";
  expected?: string;
  received?: string;
}
← Getting StartedJSON Schema Export →

On This Page

Quick Example
5 Constraint Types
Sync Validation
Batch Validation
Error Behavior
ValidationResult Type
Registry
Schema
Pricing
API
GitHub
YounndAI
YounndAIYou and AI, unifiedBuilt withNollamaNollama
© — YounndAI™. You and AI, unified. (pronounced “yoon-dye”). All rights reserved.